I need to add a “teleport” system to my game. Like Red Dead Redemption: You can travel whit a stagecoach an skip the travel (teleport to destination).
The player will use this function to fast travel by City A to City B (or C, D…) using a terminal.
Sorry bad english. Thanks
You can do something like that bro, it’s just a piece to give you some idea:
private void Teleport(Vector3 destinyPos){
//Destroy all the object that was in inspector including the player camera
Destroy(transform.gameObject.parent);
//Use this to instantiate a new Prefab of your player in the giving position in the world
Instantiate(playerPrefab, destinyPos, Quaternion.identity);
}
Hope i helped you.
this.transform.position = thatLocation.transform.position;