How to teleport a car?

I want to teleport my car through one cube to another one i tried using this script:

var destination : Transform;


function OnTriggerEnter(other : Collider) {
    other.transform.position = destination.position;
}

And this one:

var destination : Transform;


function OnTriggerEnter(other : Collider) {
    if (other.tag == "Player") {
        other.transform.position = destination.position;
    }
}

i dont know any way to make it work.

Hello @BullseyeInformatica

Make sure one has trigger collider and other gameobject with collider and rigidbody

Read this

other.gameObject.transform.position = destination.position;