Weird Issue With Characters Bones When Playing An Animation

Hello Fellow Unity Forum Members!

I’m having a weird issue with the hands on my characters in my Unity scene when they play their animations.

This is what the hands look like when the animation is playing in 3DSMax 2011:

And this is what they look like when the animation plays in Unity 3.4.1f5:

I modeled and rigged the characters in 3DSMax 2011. The skeleton is a Biped and was rigged using the Skin modifier in Max. The vertices are all weighted properly and their are no problems in 3DSMax.

When I import the characters into Unity and they are in their default T-pose, the hands look fine. When I play an animation however, the thumbs on the hands will clip into the palms and the other fingers seem to increase their scale and look fat.

The character was exported from 3DSMax as an FBX containing the mesh, bones, and no animation. The animations were exported as separate FBXs containing only the bones and animation. All exports are at the same scale, so it is does not appear to be an issue of irregular scaling between exports.

Also, I’m using the latest version of the FBX exporter for 3DSMax.

If anyone has any insight as to what’s causing this I’d appreciate the help. This is for a work project that’s due at the end of the month, so I’ve got some time to get this fixed.

Thanks.

Go to the skin modifier and under “Advanced Parameters” check the “Bone Affect Limit”.

Change it to 4 which is pretty standard for desktop games and the setting Unity has for Desktop - you can see this in the Skinned mesh properties in the inspector.

Now see how the skinning is. I’m guessing it will match your Unity results.
This means the hand shape isn’t kept together by a reasonable amount of bones, but rather some larger bones are affecting the fingers/palm too. Remove their influence.

Let me know if it is this

Hi, Koyima:

So I did what you said and here are the results I got:

The Bone Affect Limit was at a value of 20 by default.

791921--29010--$BAL_20.jpg

I then changed the value to 4 as you said and there wasn’t much of a change.

791921--29011--$BAL_4.jpg

Then, I changed the value to 2 and got the same result I’m getting in Unity.

791921--29008--$BAL_2.jpg

I then took another look at my envelopes and noticed that the Forearm bone’s envelope had some influence on the hand.

791921--29009--$envelope01.jpg

Then, I adjusted the envelope to reduce that influence.

791921--29012--$envelope02.jpg

Forgive my ignorance as I’m new to working with characters in Unity. Now that I know what the cause is, how should I proceed with reimporting these characters in Unity. Does the Bone Affect Limit need to be 4? Was my issue ultimately the forearm bone’s influence over the hand? Why does this problem not occur when the Bone Affect Limit is higher than 2?

Also, I looked at the Skinned Mesh properties under Unity’s Inspector window and did not see any reference to the Bone Affect Limit. Is it called something else?

You need to increase the number of bones Unity uses under QUALITY settings.

EDIT → PROJECT SETTINGS → QUALITY → BLEND WEIGHTS

Set that to 4. Unity can use a maximum of 4 bones, and that is what you should have set in 3ds Max.

1 Like

Hi andorov,

Got it! I just changed the Blend Weights setting to 4 and the hands look normal now. I will still change the Bone Affect Limit to 4 in the Skin modifier settings for all of my characters and then reimport them into Unity since it looks like Unity can only use a maximum of 4.

Thanks so much for the help guys! This issue was starting to bug me.

-Hush

Just a quick follow-up.

So, let’s say I have 2 bones. Each one controlling an eyeball in a characters head. Is it best practice to set the Quality value for the two eye meshes to 1 Bone. Is there any performance benefit in setting up meshes this way in Unity?

-Hush

Yes, there is a performance benefit. Is it worth the trouble for just two bones? I’m not sure :stuck_out_tongue:

hi Hush,

I mentioned the Unity setting and I said 4 is standard for desktop. I meant you should check it, but didn’t spell it out.

The issue was created by this setting in the inspector in this instance, meaning that the forearm was one out of 4 bones influencing the hand, so 4 would have the same problem.

The reality though is that it shouldn’t be influencing stuff there anyway, correct? That’s why I said:

This would be apparent in other poses later on. Since your weights wouldn’t add up, you wouldn’t have perfect control and you would wonder for instance: why doesn’t the finger mesh do exactly as the finger bone, this is a computer g0d darn 1t!@#$!@

Now think of this: say it’s the pelvis or shoulder area, you don’t want the head having even 0.01 influence there, correct? So bye,bye 20.

Since I started in game development and had to rig tens of characters fast and also for performance reasons I have made it standard practise to lower the number of influencing bones in any character, since in reality it’s highly unlikely that anything will be influenced by more than 4 bones (I actually used 3 for along time).

If it is using more than 4, then it is too complex and I need to simplify.

Now the number of vertices is set per object (on the skin modifier and skinned mesh component),if the eyeballs are attached to the body, then you can’t individually set the influence. If they aren’t attached you can just parent them (link in max).

Why don’t we just make it 2,it worked for the fingers,right? Well because there are other areas on the body that require 3 or even 4 (shoulder and pelvis mainly) and as previously mentioned we set it per object (not sub-object - in max lingo)

In most cases dividing the mesh is probably more expensive than having the bone influence set to 4.Unless we are talking about something really high-poly,unless you are splitting the mesh already by using a different shader on parts of it, eg skin shader (SSS) and eye shader (Blinn).

1 Like

If your weight maps are clean, (meaning each bone only affects one eye and not the other) it should perform the same. But you could test it to make sure.

Hey, Koyima:

Very insightful. Thanks for the knowledge.

In regards to what you said here:

My character’s mesh is currently divided up into separate meshes as follows:

Body (including hands and feet)
Head
Eye L
Eye R
Teeth Top
Teeth Bottom
Tounge

I am using different shaders in Unity on certain parts of the mesh. For example, Diffuse>Bump>Specular on the skin, Diffuse>Specular on the eyes, Diffuse>Bump on the clothing.

Also, I should note that I’m using OC3 Entertainment’s FaceFX software to translate large amounts of voice-recorded audio into facial animation, and I’ve been following the bone and mesh structure of their sample head that came with the software. The sample head has the mesh divided up the same way as above.

So, if you’re saying that it’s more expensive to divide the mesh up, could I have gotten away with the Head, Eyes, Teeth, and Tounge all being attached as one mesh instead of doing it the way FaceFx’s sample has it setup? I could have just had everything as one mesh and set up the separate elements (sub-objects) to be 100% influenced by the one or two bones that control them, instead of having six separate meshes, each with their own Skin modifier, correct?

-Hush

You could,but if you still use different sharers on each part (as you are now) it will most likely not make a difference. It would be worth grouping them by shaded/material, so that same material same skin modifier

You can do that assume FaceFX’s software works like that. I’m a programmer so I don’t know a lot of artist workflow issues, but you may want to read about the static and dynamic batching of Unity. Essentially, if you’re using separate objects and materials you’re creating extra draw calls. That’s why they have that “Static Batch Utility” to merge meshes with the same material on Awake(). If you have the Pro version you can turn on Dynamic Batching which tries to do this for you without additional setup. Depending on your target platform the extra draw calls could kill your performance (e.g. iOS).

Beyond my very basic help, I just want to say I love your post in how detailed you were and how you’ve given us pictures of even your intermediate steps. Anyone who reads this post after will definitely be able to solve any issues you’ve run into. Awesome.