- Home /
Question by
unity_OqiaMHRH6diSaA · Jun 19, 2018 at 09:38 AM ·
positionareateleporting
How can I teleport my player in fixed area
I have HTC Focus and I want to make a easy teleport system with teleport areas.
So I wrote a script like this (I simplified it) :
public GameObject zone1;
void Update() {
if(WaveVR_Controller.Input (device).GetPressDown(PadLeft)) //When the touchpad is pressed down
{
Log.d (LOG_TAG, "button Left press down");
transform.position = zone1.transform.position;
}
}
But it works only when I teleported my player the first time. When I moved around the scene and I want to come back at the teleport area, the player was teleported at the same place, like the teleportation doesn't work any more.
Furthermore I see something strange. When I display zone1.transform.position there is not the same values that in editor unity.
Comment
Your answer
Follow this Question
Related Questions
Camera rotation around player while following. 6 Answers
how to teleport player to another gameobject using the players tag? 0 Answers
Error CS0119 wont go away 1 Answer
change scene and and position 2 Answers