Unity3D Tutorial: 18 Teleporting Objects, Player, Prefabs ... Tutorial: 18

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

Disclaimer: Gambar, artikel ataupun video yang ada di web ini terkadang berasal dari berbagai sumber media lain. Hak Cipta sepenuhnya dipegang oleh sumber tersebut. Jika ada masalah terkait hal ini, Anda dapat menghubungi kami disini.

Tidak ada komentar:

Posting Komentar

© Copyright 2017 Tutorial Unity 3D