2D Toolkit Forum

2D Toolkit => Support => Topic started by: will_brett on February 17, 2013, 12:40:01 pm

Title: TK2D Collider not triggering events
Post by: will_brett on February 17, 2013, 12:40:01 pm
Hey everyone.

I've made a simple sprite and attached a box collider from the TK2D settings. I have also made a cube in the scene removed mesh renderer, and using playmaker added a trigger events action. (this works with a first person controller)

When i drag the sprite with its collider into the trigger area nothing happens... what am i doing wrong?

Thank you
Title: Re: TK2D Collider not triggering events
Post by: unikronsoftware on February 17, 2013, 07:54:05 pm
Do you have a rigidbody on one of the sprites? You should always have a rigidbody on any moving collider. Set it to kinematic if you just wanna move it instead of applying forces.

http://docs.unity3d.com/Documentation/ScriptReference/Collider.OnTriggerEnter.html
Also - as the docs say, OnTriggerEnter, etc. only work when one of the colliders have a rigid body.
Title: Re: TK2D Collider not triggering events
Post by: will_brett on February 18, 2013, 12:21:38 am
Thanks, this was the issue.