- Home /
Z Vector Teleportation Help
Hi, I am a starter at Java and Unity, I wanted to change the z position of my player. But it always says things in the console like ' "position" is not a member of UnityEngine.GameObject. ' Here is (part of) the script:
if(gameObject.postion.z == (-33)){
transform.gameObject.position == Vector3(-74.28801,30.53975,-1486.8); //This is the position that the player is teleported to.
}
}
Comment
"position" is not a member of UnityEngine.GameObject. means gameObject
does not have a variable/getter-setter named position
.
position
belongs to transform
, just use transform.position == ...
.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
"Expecting ), found ';'" and "';' expected. Insert a semicolon at the end" 1 Answer
Error CS1502 Help! 1 Answer
What does this error mean? 2 Answers
I keep getting this error? 1 Answer