- Home /
Question by
hoogmin64 · Sep 07, 2015 at 03:48 AM ·
development
How do i create a respawn point
hello i am 14 and want to know how to make a respawn point.when i jump off a cliff in unity i will fall infinitely.how do i get my character to respawn back were he started at a certain point when falling?
Comment
Answer by Whitecold · Nov 14, 2015 at 10:07 PM
The simplest possible way is to attach a script to your player and check the z coordinate during update
void Update(){
if(transform.position.z<-10)
transform.position = new Vector3(0,0,0);
}
If you fall, as soon as you reach height -10 the position is reset to the start, here 0,0,0
Answer by Endiss · Nov 14, 2015 at 10:07 PM
make gameobject name it get his position change ur position to equal that object:)