playMaker

Author Topic: trigger enter in RTS with no rigidbody  (Read 4472 times)

santelia

  • Junior Playmaker
  • **
  • Posts: 78
trigger enter in RTS with no rigidbody
« on: July 12, 2012, 11:34:27 AM »
I'm facing a problem.
I need to detect a trigger enter where the owner of the trigger (a boat with a trigger sphere collider and some usual mesh colliders) has no rigidbody. The goal is to detect enemies, that too have no rigidbody and have an enemy layer and  an enemy tag. It might be the easiest task of the universe, but it doesn works. When an enemy object enters the trigger, simply the start state doesn't passes the "TRIGGER ENTER" event to the second state.
Any idea?

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: trigger enter in RTS with no rigidbody
« Reply #1 on: July 12, 2012, 01:14:07 PM »
Searching into Unity Answers, it appears that onTrigger call is launched only when an active rigidbody enters a listening collider. E. g. see http://answers.unity3d.com/questions/223493/performance-trigger-on-objects-or-on-player.html.
But in some cases rigidbodies bring problems to certain game processes, and for my experience they can give you heavy headaches when dealing with water... ;D
Any help for my need of triggering?

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: trigger enter in RTS with no rigidbody
« Reply #2 on: July 12, 2012, 01:16:27 PM »
UPDATE: added rigidbody to a couple of enemy tagged and layered objects, but nothing differrent happens...
 >:(

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: trigger enter in RTS with no rigidbody
« Reply #3 on: July 13, 2012, 09:23:10 AM »
Hi,

 what's in your trigger state?

"TRIGGER ENTER" is a built in event right, you haven't created that event. put trigger enter as a global transition of the state "raycast" and see if it improves.

 else, add a rigidbody set to iskinematic to the routine radar. check if that helps.

 bye,

 Jean

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: trigger enter in RTS with no rigidbody
« Reply #4 on: July 13, 2012, 10:19:15 AM »
As soon as I'll have finished my giant icecream  ;) , I'll try to make it.

santelia

  • Junior Playmaker
  • **
  • Posts: 78
Re: trigger enter in RTS with no rigidbody
« Reply #5 on: July 13, 2012, 01:28:57 PM »
So, these are the results:
Adding a global "TRIGGER ENTER" transition to the state "raycast" doesn't reach any result.
Generally, it seems that the TRIGGER ENTER system event doesn't works at all for this RTS. Strange behaviour, since in my RPG project I use it for a hundred triggers - activated by PLAYER with character controller (all it's WOW system) - and it works perfectly. Imhave to believe that it worsk ONLY with character controllers.
So, adding a rigidbody both to the routine radar and to the enemies, and sending a custom event and NOT the system one, everythin works fine.
Again, strange behavior...   ???