Check collision with certain gameobject?

I have 2 objects that should collide. “Pickup Truck” and “Finish”.
This script is on the “Finish” gameobject, but it doesn’t actually do anything:

var carName = "Pickup Truck";
function Update () {
	
}

function OnCollisionStart(collision : Collision)
{
    if (collision.gameObject.name == carName)
    {
        print("Collide!");
    }

}
  • The function is “OnCollisionEnter” not OnCollisionStart.

  • Be sure you have colliders attached to both Pickup Truck and Finish

  • Be sure moving gameobject has also a rigidbody attached

  • If “Finish” is a static gameobject put the script in the moving gameobject changing the necessary code about name etc…

  • I don’t know what else can I tell you now… :slight_smile:

Thanks, the first thing did it!