How to have precise transform position for complex Blender Models with animations?

So I have just started experiencing this problem last night as we have upgraded our main character’s .fbx model. So I have not had enough time yet to really try to figure out many solutions. But I wanted to just ask this question here from the start in case anyone already understands how this works.

Right now the player’s movement logic as well as how enemies respond to the player is based off of the default transform.position of the previous model. For that model the transform position was centered in his chest and appeared to stay there no matter what animations or positions occurred.

I am now attempting to implement a new .fbx model which is much more complex than anything I have made myself, so I don’t even really understand exactly how our artist made it (I believe they used the Rigify Add-on for Bipedal characters as well as most likely Inverse Kinematics).

The reason for some of the added complexity is to have features like swapping armor, so currently the armor the player is wearing can be repositioned separately from the characters actual body while in Blender. But it does appear as expected while in Unity. Could this have some kind of affect with this problem?

The problem is that the new models Transform position is not where it should be according to the Blender origin point. I have even gone into Blender and manually set the origin point to try to fix this.

The origin points appear to be below the character’s feet? Is this caused by the Rigify Ad-don for Bipedal characters?

I don’t understand how Unity calculates the .fbx objects transform.position?

With our old more simple model it seemed to automatically be set to the center of the models regardless of animations.

Is there certain kinds of animations or rig set ups that would cause Unity’s transform.position to not stay centered in the characters chest? Is it possible that Unity calculates every single armature and cube and then bases the transform position at the center of all that?

This would cause the transform position to constantly be shifting to different areas relative to the player model based on the animation?

I could be completely wrong, but I am having trouble quickly finding any kind of helpful information about this in all of my searches so far. I figured that asking here would be a good idea if someone happens to have these answers :slight_smile:

I am about to attempt a solution for this problem by creating a new empty object within the player model which will be used to give the accurate and consistent transform positions. However I am concerned that this position will not be accurate if it is based on the other problems I described above, it may itself not stay positioned as expected.

In my early testing of this new object, it already seems to have the capability to become off center even while having the IsKinematic box checked on the rigid body. Perhaps I need to create a completely empty object for this, as the current one is used for trigger events?

REALLY need any help with this, I have never encountered anything like this with all other .fbx models, I have NO CLUE what is going on or how Unity calculates Transform positions for something like this?

Please help!

The mesh’s center point is simply its center point. A mesh is always built relative to Origin, and Unity just applies a transform matrix to the mesh.

In the upper left of Unity there’s a button that says either Pivot or Center; click it to swap to the other and see if that fixes what you’re seeing.

In Pivot mode you see the object pivot, in Center mode it’s the average position of all selected objects.

You can child your visual model to a control object (very common practice, separate graphics and logic).

Unity only gets polygons, bones, and animation from the FBX file; doesn’t matter what was used to generate it (IK/FK, Rig Addons or whatevs).

Just wanted to add that a lot of these problems with having inconsistent transform positions were caused simply by the .fbx settings in Blender. For example there are multiple different ways you can set the origin transform by pressing CTRL-ALC-SHIFT-C in Blender like:

Geometry to Origin

Origin to Geometry

Origin to 3D Cursor

Origin to Center of Mass

I recommend you find a consistent way of setting the transform positions through the .fbx for all your models to avoid the headaches I went through when I first started working with 2 different artists models that were very inconsistent in this regard.

The only thing I still don’t fully understand about the .fbx files being imported from Blender are the bounding boxes in Unity. I’m not sure how they calculate these but they seem to be be very important in occlusion culling calculations and they often times have been extremely inaccurate in size and require manual adjustments.

Not sure if this is something my artist caused on certain models or Unity bugs.