- Home /
Discrepancy between editor scale values and transform.localScale query?
Hi Folks, I noticed that scale values for imported joints (maybe other objects as well) that are displayed in the editor don't coincide with values I'm getting from transform localScale.
I created a test scene with a single joint to rule out segment scale compensate issues. I've hooked up a script that gets the joint's transform.localScale and applies that value to the localScale of a 1,1,1 cube.
void Update () {
this.gameObject.transform.localScale = myObj.transform.localScale;
}
But there seems to be a discrepancy:
Values for single joint in inspector:
Values at same frame for cube:
Is this simply a precision error? If so, it seems like a great deal of precision lost! If that were the case, is there a way to increase precision?
Any help greatly appreciated!
Answer by hawksandwichgames · May 30, 2018 at 02:28 PM
I'm gonna take a wild guess and say the problem is that you're looking at the world scale in the inspector, but you're messing with the local scale in code. If you right click on the inspector tab, you can go into Debug mode, which will show you local scale. See if the local scale on both objects are the same. If not, sorry I couldn't help haha
Your answer
Follow this Question
Related Questions
Legacy Animations Broken Behavior in Animation Tab (Unity 5) 1 Answer
Object changes position/rotation, when moved (in/out of parent) in the heirarchy in the editor! 0 Answers
Drawing a custom variable in the inspector y position bugs selection 0 Answers
Can't move GameObject in Scene view with Unity Components attached 2021.2.2f 0 Answers