Reputation: 13
I have an OOTB terrain (GameObject > 3D Object > Terrain)
-Terrain Collider component
I have an OOTB sphere (GameObject > 3D Object > Sphere)
-Sphere Collider component
I have this script attached to the sphere:
void OnCollisionEnter() { // do something }
The sphere intersects the terrain; code does not trigger.
Why? What do I need to have them collide? I tried having the sphere hit a cube and it won't work either.
Upvotes: 1
Views: 104
Reputation: 317
As they said in the comments, you need a Rigidbody to detect the collisions, if you don't want the object to be affected by the physics of unity just check isKinematic
Upvotes: 1