How to move a object from A to B when the character collides with a object?

Hi. I have a spawn point where my player spawns. But I also have checkpoints, and I want that when the player collides with a checkpoint to move the checkpoint to a certain x,y,z position. I’ve tried to do it several times but without success. Anyone can help?

Do you mean a teleporter?

Add this to your checkpoint:

function OnTriggerEnter(item : Collider) {
    if(item.tag == "Player")
        transform.position = Vector3(x, y, z);
}

This will move the checkpoint to whatever xyz coordinates you use, when an object with the tag ‘Player’ enters the checkpoint’s trigger.

If you want to move the checkpoint multiple times to different locations, use a public array and put empty gameobjects from the scene there via the Inspector. Instead of using a specific Vector for the new position, you use ‘array*.transform.position’ and increment ‘i’ afterwards.*