Hi I am new to unity, I have written a re-spawn which works if the character falls off the edge of the map, however once the player collides with the enemy the re-spawn text will appear and the game will stop, however once I press enter nothing happens and the player is stuck. Any help would be great thanks :)
Here is my code:
onTriggerEnter()
{
if(other.gameObject.tag == "enemy")
{
deadText.text = "You died Press Enter to Continue";
Respawn();
}
}
void Respawn()
{
Time.timeScale = 0.0f;
if(Input.GetKey("enter"))
{
Time.timeScale = 1.0f;
deadText.text = "";
transform.position = transform.position = new Vector3 (0f, 2f, 0f);
}
}
↧