Thunder Soul
Thunder Soul

Reputation: 13

New to Unity3D; unable to collide two simple objects

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

Answers (1)

cjf93
cjf93

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

Related Questions