Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

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:
    816
  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:
    816
    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.