Question by
pandasniezna · May 10, 2017 at 02:25 PM ·
transform.positionteleportwait
[Newbie in js] "wait" and teleporting devices
Hello!
I've done 2 teleporting pillars. Entering "1teleport" telleports player to "2teleport" and its working well:
var warptarget : Transform;
function Update () {}
function OnTriggerEnter (col : Collider) {
if (col.gameObject.tag == "warp001")
this.transform.position = warptarget.position;
}
on 1teleport: collider/trigger with tag "warp1"
on script attached to FPScontroller: 2teleport is marked as warptarget
Everything is working ok. But ive tried to make a wey to go back. Ive done another script with tag "warp2" and done as above but I discovered, that trigger "warp2" and destination for second warp target, cant be in same pillars.
So, if Im right, I need to make it like "when script1 or script2 is activated, wait until FPScontroller leaves triggers warp1 or warp2".
Am I right? And how to do that? :)
Comment
Your answer
