OnCollisionEnter is not called in unity

前端 未结 6 1858
走了就别回头了
走了就别回头了 2021-01-04 06:10

I checked nearly every answer for this, but those were mostly simple errors and mistakes. My problem is that OnCollisionEnter is not called even when colliding whith other r

6条回答
  •  孤街浪徒
    2021-01-04 06:59

    Are you using 2D colliders and rigidbodies? If so use this function instead of OnCollisionEnter

    void OnCollisionEnter2D(Collision2D coll)
        {
            Debug.Log(coll.gameObject.tag);
    
        }
    

提交回复
热议问题