playMaker

Author Topic: Problem with dynamic trigger checking  (Read 890 times)

liv4luv

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Problem with dynamic trigger checking
« on: November 22, 2012, 02: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.


jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13857
  • Official Playmaker Support
    • View Profile
Re: Problem with dynamic trigger checking
« Reply #1 on: November 22, 2012, 02: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