Advertisemen
Unity3D Tutorial: 18 Teleporting Objects, Player, Prefabs ....
THIS IS Java scrip: GOOD 4 2D GAMES AND 3D GAMES !
Download Script HERE
---------------------------------------------------------------------------------
THIS IS BACKUP IN TEXT FORM TUTORIAL 18
1. Create New java and name it : Simpleteleport
2. Copy & Past this text and save java :
var TeleportEndPoint : Transform; //drag your point to here in the Inspector
// var spawnPoint : Vector3 = Vector3(0, 10, 0);
function OnTriggerEnter(other : Collider)
{
if (other.gameObject.tag == "Player")
{
other.transform.position = TeleportEndPoint.position;
// other.transform.position = spawnPoint; // fixed vector method
}
}
---------------------------------------------------------------------------------
Advertisemen
Tidak ada komentar:
Posting Komentar