Hey!
How can i do so that if my character fall down from the platform he get’s teleported back to a starting point??
plz help!
Hey!
How can i do so that if my character fall down from the platform he get’s teleported back to a starting point??
plz help!
I’m new to unity but i’ll give this a go…
add an empty gameobject to act as a spawn point (you just want the x,y,z position really), add a game object with a collider component underneath the platform somewhere to act as the detector… then you “just” need a script with an onCollision function attached to the collider gameobject which detects the player hitting the collider and takes the spawn point as a variable so it can do “player position = spawn point position”.
… at least that’s what i’d be looking into doing.
it’s as simple as putting a trigger and saying something like:
void OnTriggerEnter(Collider other)
{
if(other.collider.CompareTag(“Player”)
{
other.collider.transfom.position = spawn.position;
}
}
keep in mind that if you copy and paste this it’s not going to work, this is just a example
goes off and looks up onTriggerEnter vs onCollisionEnter
ah, so trigger over collision because we don’t need the impact point data etc. more light weight and speedy. Gotcha.