hi does anyone know a script that changes player position if the player collide with the object. or. can anyone make me a script that changes player position if the player collide with a object(3d model)
Yes yes...
private var Dead = false;
function OnControllerColliderHit (hit : ControllerColliderHit)
{
if(hit.gameObject.tag == "hello") <--- Write whatever you want. make sure that you object that you collide with has the same tag.
Dead = true;
}
function LateUpdate ()
{
if(Dead) transform.position = Vector3(0,2,5); <---- Write you posision you wanna spawn on x,y,z
Dead = false;
}
Hope that helped. :)