Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: liv4luv on November 22, 2012, 04:31:22 AM

Title: Problem with dynamic trigger checking
Post by: liv4luv on November 22, 2012, 04:31:22 AM
Hi i am a complete newbie with playmaker.
In my game i am randomly placing the buildings in the world,checking everytime if placed building is getting collision with already placed building,then repositioning the new building.

For this purpose i have used box collider of the building size with is trigger check box selected and used on trigger enter for checking.


But still the buildings are not generating trigger events when collision is happening. ???

Can you please suggest what i am missing?or how i can debug this?Or is there any other approach for achieving this.

Title: Re: Problem with dynamic trigger checking
Post by: jeanfabre on November 22, 2012, 04:45:20 AM
Hi,

 Spawning physics is problematic with collision detections, at least that is what I experience. one way it to implement a OnCollisionStay, which is going to tell you what you want, BUT it is very inefficient, with a lot of over head.

I would go for a totally different approach to solve your problem.

In the random placement procedure, I would pick a random location and fire 4 ray cast from above ( the four points being the four corners of the building you will spawn. If one of these ray hit a building, then you need to move it, else you can commit the spawning.

 bye,

 Jean