Search Unity

OnTriggerEnter not being called

Discussion in 'Physics' started by jbjbjbborisb, Oct 28, 2015.

  1. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    I have two game objects:

    1) A player
    - With a rigidBody 2D
    - With a box collider

    2) A pick up item
    - With a rigidBody 2D
    - With a box collider
    - With "IsTrigger" checked
    - With "IsKinematic" checked

    Both game objects have a script attached, which includes a "OnTriggerEnter" function.
    But on collision neither of the functions is called.

    What could be the problem?
     
  2. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
  3. jbjbjbborisb

    jbjbjbborisb

    Joined:
    Jun 8, 2014
    Posts:
    54
    Good to know there are separate functions for 2D physics :)
    It works, thank you!
     
  4. Johannski

    Johannski

    Joined:
    Jan 25, 2014
    Posts:
    826
    Glad I could help :)
     
  5. larswik

    larswik

    Joined:
    Dec 20, 2012
    Posts:
    312
    After 3 hours of searching this turned out to be my problem. Thanks.