Hello Guest

Author Topic: TK2D Collider not triggering events  (Read 4639 times)

will_brett

  • Newbie
  • *
  • Posts: 6
    • View Profile
TK2D Collider not triggering events
« 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

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: TK2D Collider not triggering events
« Reply #1 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.

will_brett

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: TK2D Collider not triggering events
« Reply #2 on: February 18, 2013, 12:21:38 am »
Thanks, this was the issue.