- Home /
The question is answered, right answer was accepted
Transform position changes multiplies value by 7.61
So, I have an empty game object. I am instantiating it with a UI element as its parent. When I try to modify it's position after that, the Z changes to about -658
when I don't modify it at all, and the X and the Y go to the correct value but multiplied by around 7.61
. I noticed the scale also goes to 7.61
for everything. I am sure this is a bug, so I don't want to just divide by 7.61
every time, in case the bug isn't present in the build and breaks the whole thing. Any ideas as to what might be causing this?
This isn't a familiar issue.
It sounds like the object you're talking about has a parent with scale applied.
Answer by Liaram · Jul 24, 2018 at 01:45 AM
Just thinking out loud here but if you're instantiating an emptyObject as a child to a UI element then the emptyObject should have a RectTransform and not a regular Transform. Are you moving it using the RectTransform.anchoredPosition? UI elements move relative to it's anchor to it's parent element.
Follow this Question
Related Questions
Stop moving at the target position by using Vector3.forward 0 Answers
Match position of two object without making one a child of the other 4 Answers
Transform.Position Collision Issue 0 Answers
UnityEngine.Component:get_transform() Error 1 Answer
Drawing a (debug) line between anchored UI element and mouse? 0 Answers