Hi, everyone, my first post here, apologies in advance.
So I’m not necessarily new to coding or 3d modeling, but I am new to unity, and I’m seeing some strange behavior while I’m playing around with the editor in the VRChat SDK examples. I have two related questions.
First question. I begin with a 3d object > cube. After making some changes to the transform scale to modify its shape into a stick, I then make a child object of this cube. When I try to transform rotate this child, the Y rotation works fine. However, the X and Z rotations, instead of rotating the cube, it shears/squishes it.
I would have imagined that the transform values are just relative to the parent values, but it doesn’t seem that that’s the case.
Second question. In the Scene hierarchy, I would like to be able to organize my objects by having basically empty parents with child objects. But, similar to the above, it seems like the transform values don’t just reflect the relative values. Is there a way to just create an empty object that has no center that modifies the child object transforms? The transform page I found in the user manual seems to not address this at all. I’m not sure if my math is just so rusty that this isn’t making sense, but I was really hoping to build some basic geometry without this kind of trouble.
The values you see in child objects are local to their parents, but, naturally, they still ‘inherit’ all the transforms of their parent, such is the nature of transform hierarchies.
The answer to your second question is no. All game objects in a scene have a transform. Having ways to organise one’s hierarchy has been long requested, mind you, so maybe one day. Or there’s addons for that.
So basically, to avoid the shearing, I have to consider the transform matrices in their full parental hierarchy? Seems like something you’d want to be able to toggle at the very least, but I think I get how to fix my problem, even if it’s going to be insanely inconvenient. At that point it’s probably better to just make independent objects and throw them all in the hierarchy and do the math to transform them instead of trying to rely on the parental relationships?
Unfortunate news. Especially about the lack of ability to organize the hierarchy. Seems like a somewhat obvious oversight, but such is life, I suppose.
Thanks for taking the time to respond, I appreciate the help!
Nah all you have to do is follow a pretty simple rule of thumb:
If an object has children, do not scale it non-uniformly.
That’s it. Following that one rule you can avoid all weird shearing/warping issues. If you do need to scale an object non-uniformly, just throw the Renderer or Collider that needs to be scaled on a separate child/sibling object that doesn’t have children of its own and move on with your day.