Hi , how i can add a gui message in the center of the screen , after the teletransportation ? the message (RESPAWNED) ?
var TelePosition : Transform; // drag the destination empty here
function OnTriggerEnter(other : Collider)
{
if (other.tag == "Player")
{
// move and align the player to the destination empty GO
other.transform.position = TelePosition.position;
other.transform.rotation = TelePosition.rotation;
}
}
Place it where you want it to be and change its text to RESPAWNED.
In your script add a variable for your text gameobject which you just created. Make sure to deactivate for example in the start function.
When the player enters the collider, call the function below using StartCoroutine(RespawnText());
And the function is
function RespawnText () {
respawntext.setActive(true);
yield WaitForSeconds (5.0f);
respawntext.setActive(false)
}
This script will activate the text, wait for 5 seconds and then hide it again. I haven’t tried it myself and im not used to JS but it should work. This script is really simple and might have a few bugs depending on how you use it but they should be fairly easy to fix.