Question by
Nintendough · Nov 13, 2019 at 03:08 AM ·
error3dscript.respawn
Respawn Script Is Not Functioning
using UnityEngine; using System.Collections;
public class RespawnScript : MonoBehaviour {
public Transform respawnPoint; //Place holder for the spawn point
// Triggers when the player enters the water
void OnTriggerEnter(Collider other)
{
// Moves the player to the spawn point
other.gameObject.transform.position = respawnPoint.position;
}
}
I've set up a plane that should cause a player to respawn at the starting point when the player falls into one of these pits. I loaded this respawn script into it along with a spawn point but the player isn't sent back to the starting point after falling through a pit.
capturedude.png
(466.1 kB)
capturedudes.png
(482.8 kB)
Comment