Changing Y position of transform position has no effect.
I am trying to change the position of a game object, but the y-position stays zero.
I have tried assigning a Vector3 to the gameObject.transform.position. The x and z coordinates are correctly set, but the y value remains zero after checking it with a Debug.Log.
I have tried setting the transform position in the Inspector directly while running the game. Changing the x and z coordinates immediately have an effect. Changing the y value to for example to 10 has no visual effect while the y position value in the inspector is indeed 10.
This only applies to game objects parented to a certain game object. But I can't see anything unusual on the parent game object.
Cheers, Rob
Post us some code! :)
If it's related to objects parented to a certain game object, then I'm guessing there's a script on that object (or a script controlling that object) that is causing the problems.
Answer by RobGraat · Dec 21, 2015 at 10:24 AM
The parent game object had a y-scale of 0
I knew it would be something stupidly obvious :p
Your answer
Follow this Question
Related Questions
Vector3 is not receiving enough arguments from a another script that gives out transform.position. 1 Answer
Proplem in move 3D AR object from point to point at run time 0 Answers
How to correct the scale when using Transform.TransformPoint 2 Answers
Unity 3D interface says my button has a rectTransform C# script says otherwise 0 Answers
How to attach an object to another object so that moving one moves the other 0 Answers