Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

[Solved] Use OnCollisionEnter or OnTriggerEnter without Rigidbody ?

Discussion in 'Getting Started' started by skyLark9, Jul 10, 2018.

  1. skyLark9

    skyLark9

    Joined:
    May 2, 2018
    Posts:
    119
    It possible to use OnCollisionEnter or OnTriggerEnter in object without rigidbody ?
     
  2. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,591
    I found these answers:
    https://answers.unity.com/questions/33120/oncollisionenter-doesnt-work-without-rigidbody.html

    https://answers.unity.com/questions/536674/how-to-detech-collision-without-rigidbody.html

    When using these I think both need at least one of the gameobjects to have a rigidbody for collision processing. It doesn't have to be an non-kinematic rigidbody though - so if you have objects you don't wanna do physics (like gravity) for, you can attach a rigidbody still to it, and set the kinematic checkbox. Then when that object hits your trigger or another object with OnCollisionEnter then it should work.
     
    Memaxe and skyLark9 like this.
  3. skyLark9

    skyLark9

    Joined:
    May 2, 2018
    Posts:
    119
    Thank you MD.
     
  4. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,591
    No problem, good luck! :)