# Scaling width/height of a character's head/body

I want to scale width/height of my character’s head/body mutually independently.

But due to the bone structure as shown below, When scale the body(Hips bone), the head is also scaled.

``````Hips
Pelvis
...
Spine
...
``````

So my code is like this and it seemed to be worked.

``````void LateUpdate()
{
HipsTransform.localScale = new Vector3(hipsWScale, hipsHScale, hipsWScale);
}
``````

But rotating the spine(for animation), the head is skewed. This is my problem.

I found that this is common mathematical issue but I want to know how to solve it.

Unity’s transform matrix and global scale is read only. How should I do?

Is there any way to scale width/height of my character’s head/body mutually independently?

Thanks.

One way to do “scaling” is just to have two bones above move them further apart, thus stretching the skin between them. Combined with uniform scaling, this may be sufficient for what you’re trying to do.

And I am worried just about the same process.

Version 3.3 of my environment Unity3D, is the iPhone Pro Android Pro.

The local scale of the bone, what’s a setting not solve, such as to affect the local scale of the bones of the child?

As far as experimenting with Maya, there is no problem changing the scale of the bones are free to
In the same way I do it Unity3D.

Scaling of bone in the other games I use the Avatar seems like doing.

How well do you resolve it not?

The skewing you see is exactly what you should expect. While you may seem to be scaling bones in Maya, perhaps you’re just scaling the bone envelope. Regardless, once you have the model in Unity, any non-uniform scale of transforms will cause a skew in child transformed bones. You can see this effect in normal unskinned meshes too.

The reason is that scaling does not happen by a multiplying of X, Y, and Z independently, any more than position is merely the sum of parent transforms by independent axes. You would not want the arms to move 5 units along their Y local axis every time the player jumped the spine by 5 units vertically. So similarly, scaling the body by 5 times in the Y will not make the arms 5 times longer in their Y.

Only uniform (equal x,y,z) scaling will appear unskewed on child transforms (bones or otherwise). There is also no simple “unscaling” you can do in child bones.

As a corollary, you can safely scale the final bones non-uniformly (since they have no children).

Yeah, don’t do non-uniform scaling - it will look weird when you will start animating the character (for example hands will be longer when they are in front compared to when they are at the sides).

Non-uniform scaling CAN be done for skeletons without causing skew. In order for it to work, though, you’ll need to invert the scale in the next node down. There must be one of these auxiliary nodes for each child of the original bone which you want to scale, and it must have the translation from the original node, the inverted scale, and NO rotation. Suppose you had a character with the following bone structure:

``````Hips
Spine
LUpperArm
LForeArm
LHand
RUpperArm
RForeArm
RHand
Neck
LThigh
...
``````

In order for this to work, you’ll need auxiliary nodes for LUpperArm, RUpperArm, and Neck:

``````Hips
Spine // Contains non-uniform scale
LUpperArmAux  // Contains inverse scale of Spine, translation from LUpperArm, and no rotation
LUpperArm  // Contains no translation
LForeArm
LHand
RUpperArmAux  // Contains inverse scale of Spine, translation from RUpperArm, and no rotation
RUpperArm  // Contains no translation
RForeArm
RHand
NeckAux  // Contains inverse scale of Spine, translation from Neck, and no rotation
Neck  // Contains no translation