Hi, im currently trying to get a checkpoint system to work in my game, I have a Kill Volume(as shown in picture 1) that when you touch it, it spawns you back at the beginning, as shown in picture 2!
Which spawns you back here!!!
And when you hit a checkpoint, shown as the other square in picture two, the kill volume should spawn you at the checkpoint(square2) rather than the original spawn point(square 1).
This is my killVolume code, which sends you to the original starting zone
var dest: Transform; // drag the destination object here
function OnTriggerEnter(other: Collider){
if (other.tag == "Player"){
// move the player and align it to the dest object:
other.transform.position = dest.position;
other.transform.rotation = dest.rotation;
I have this so far as code to spawn me at square two
static var dest: Transform;
function OnTriggerEnter(item : Collider)
{
if(item.tag == “Player”)
{
“RestartScript”.dest.Transform = “Checkpoint1”.Transform;
}
}
It obviously not working, which is where you all come in. Any ideas on what I could change for the checkpoint script? I have it to where it will respawn the player at the original spot(square1) when I die, but when I hit the checkpoint and die, it doesnt spawn me at the checkpoint(square2).