Scaling bones

Does anyone know how to locally scale a bone in unity? transform.localScale isn’t a local scale.

I take an object with a bone hierarchy and I scale the root bone down. I then want a child to still be at 1:1 scale. So I’m finding that particular transform and trying to scale it back up without skewing. It sways from side to side so I figure I have to scale up in the local transformation. Unfortunately I can’t figure out the correct combination of commands. I’ve tried messing with TransformDirection, and the localToWorldMatrix/worldToLocalMatrix commands with no luck. Can anyone help me out?

	void LateUpdate()
	{ 

		GameObject skeleton = GameObject.Find("character");
		Component[] transforms = skeleton.GetComponentsInChildren(typeof(Transform));

		skeleton.transform.localScale = new Vector3(1f, 0.61583f, 1.0f);

		foreach (Transform t in transforms)
		{
			if (t.name == "head")
			{
				Vector3 scaleVector = Vector3.one;
				scaleVector.x /= skeleton.transform.localScale.x;
				scaleVector.z /= skeleton.transform.localScale.y;
				scaleVector.y /= skeleton.transform.localScale.z;

				t.localScale = scaleVector; // skeleton.transform.TransformDirection(scaleVector);

			}
	}

I have the exact same problem, did you have any luck finding a solution to this ?

It seems like something that really should be possible.

Ok I have a work around for this, if anyone else is interested.

Lets say I want to scale up a characters upper arms to make them look more muscular, but I don’t want to mess up the scaling of the lower arms/hands.

What I do is add an extra bone that is a child of the upper arm and runs parallel to the upper arm. This new bone has no children. I use the new bone for scaling the arm, and the original bone for rotating it. The new bone has all the weighting (the old bone has no vertex weights at all, it doesn’t need them because it has the new bone as a child).

Now I can scale the upper arm as I want with the lower arm staying the same.

Hope this helps someone.

1 Like

Zomby138, I am using CS bone in 3dsmax, how to add an extra bone???[quote=“Zomby138, post:3, topic: 410161, username:Zomby138”]
Ok I have a work around for this, if anyone else is interested.

Lets say I want to scale up a characters upper arms to make them look more muscular, but I don’t want to mess up the scaling of the lower arms/hands.

What I do is add an extra bone that is a child of the upper arm and runs parallel to the upper arm. This new bone has no children. I use the new bone for scaling the arm, and the original bone for rotating it. The new bone has all the weighting (the old bone has no vertex weights at all, it doesn’t need them because it has the new bone as a child).

Now I can scale the upper arm as I want with the lower arm staying the same.

Hope this helps someone.
[/quote]

Sorry for the incredible ‘necro’, but thank you for this!
this sounds like its what I am after, but I don’t quite understand…

I duplicated the thigh bone named ThighLeft (for example) and made the thigh bone (ThighLeft) the parent of the duplicate (ThighLeftDuplicate), but nothing happens when I scale rotate or move ThighLeftDuplicate.

It has no weight painting like you said, but it also does literally nothing…
Any help would be most appreciated
I am doing this in Blender

@Just2Ask
Duplicating the bones will not assign the proper weights to the new bone, since each vertex group is assigned according to the bone group / name.
You need to copy the weights from the original bone to the helper bone. Or renaming the vertex group to the new bone.

1 Like

Thank you for the response; I really appreciate it
I will try this out

It worked 100%!!
I cant thank you both enough!

1 Like

Wow, what a blast from the past! I’m glad my post was able to help someone so long after it was written.

I should mention that if I wanted this sort of behavior today I would probably use shape keys rather than bone scaling.

1 Like

shape keys would be quite time consuming for clothing though?

Do not necro threads. This thread is over 12 years old. The last post was over 4 years ago.