OnCollisionEnter is not called in unity

前端 未结 6 1908
走了就别回头了
走了就别回头了 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:51

    You need to make sure that the collision matrix (Edit->Project Settings->Physics) does not exclude collisions between the layers that your objects belong to.

    Unity Docs

    You also need to make sure that the other object has : collider, rigidbody and that the object itself or either of these components are not disabled.

提交回复
热议问题