I have a strange problem on several models and animations. They were working just fine until recently, but then, somehow, their pivot point/origin changed, and now it is in the center of the model, not at the feet, as it used to be. As you can see in the screenshot, this means that the model is grounded at waist level, rather than at feet level.
Could that have changed in Unity somehow–and if so, how do I move it back to the correct location? Or do I need to have a Maya artist open up the files in Maya and reset that point at the feet?
Geez, no ideas? I’ve rolled back to model files and animations from a month ago, when there was no such problem, but it doesn’t solve it, so I’m thinking the problem is in Unity, not in the Maya models themselves. Is it possible to move that pivot/origin point on a model within Unity?
Thanks! I have checked that Pivot setting, and it’s correct. With more testing, I can now see that the problem occurs only when I have the Idle animation applied to the model–AND set to loop. When it is set to Default, the model stands on the ground, when set to loop, the model is half underground (and during Play, the pivot point has changed to being at waist level instead of foot level). When I put the animation file itself in the scene, the pivot setting is correct, but it seems that something happens when it plays that I can’t see nor adjust. Again, this worked fine until recently. Any more ideas?
Well, I’m going to assume that you have this character parented to a EGO with a character controller. Where is the Pivot of the EGO in relation to the character?
yes, we’ve set up an NPC controller GO, and the models are parented to it. Its pivot point is at the bottom of the capsule collider, and it works fine with most of the character models. In the attached screenshot, I took an NPC controller that works properly with a male model, duped it and put the female model in there, and she’s half below ground. I’ve got the NPC controller GO selected here on both of these, so you can see it’s at the bottom of the capsule collider. I just can’t figure out where the problem is.
It sounds like one of the objects, GO or controller, has had it’s pivot moved and because of a change to the parent/child hierarchy the female is not where you expect her to be.
For instance… female models pivot is at her feet and keyed at 0,0,0. You now place her in a GO which has it’s pivot in its center and then move the GOs pivot down to the ground. Because the female model is a child of the GO it’s using the GO coordinates instead of world coordinates. Since the GO pivot was changed after children were added to it’s hierarchy the child object starting position has changed as well.
Yeah, that seems like the basic problem, but the GO, model, and animation files all have the pivot set at the feet—until the animations play, at which point the pivot seems to switch back to the middle of the model. I examine the GO, model, and animation files individually in the scene, the pivot is always at the feet, but when I apply an animation to the character model, and press Play, the pivot point jumps to the waist area. It’s like there’s a pivot point in the animation that only activates on play, and I can’t adjust it.
Sounds like your animation has keyframes on the root object of your character for the animations, it seems very likely to me.
An example test could be:
make a child game object of the controller, that is the parent of the animated mesh, and place it at the half way point, and put the childs feet at the orgin of that object.
Press play, and if the character looks right, then there are keyframes on your model’s root object.
Any way you can strip the file down so we can see what’s happening without giving out assets that shouldn’t be in the wild? It would be much easier to troubleshoot.
Barring that, where was the model/animation when it was originally keyed in the 3D app? It could be that it was keyed at 0,0,0.
Here are the two models that are a problem when combined–apply the “stand_idle” animation to the “female_whitecap” model, and the model snaps down 1 meter, as the pivot point shifts from feet to waist. I tried these in another project and have the same problem. But I used them together for several months without a problem, until last week. Just stumped about what might have changed.
These are maya models, not sure if you can import the package without Maya installed.
Yeah, I’m sure it’s something simple that has just been overlooked. I’m on the road and don’t have Maya installed on the laptop. If you could export out of maya as .fbx I’d be happy to take a look.
Thanks for the help, Sammer! Unfortunately, I don’t have Maya (only an unlicensed install for importing .mb files into Unity), so I cant export it as fbx. Darn it!
I’m still having this problem. It looks like the FBX import into Unity caused the orient to change on the main locator for the rig. Something changed with that import process in July to result in that, next time I reimported the models and animations.
I got the latest Autodesk FBX importer and installed it, but importing the models again doesn’t fix the problem (though since I have an unlicensed Maya 8 on my computer, only for the Unity import process, I’m not entirely sure if that FBX update had any effect on Maya).
The problem only happens when I apply an animation in a separate file (using the same rig, though) to a model. (The mesh differs–different clothing–so I have to apply the separate animation files to the main model.)
STEPS TO REPRODUCE PROPER EXPORT OF MAYA RIG TO UNITY:
IN MAYA:
0.0 SET MAYA UNITS TO METEERS
0.1 PUT RIG + MESH IN THE ROOT (MAIN, ZERO) LEVEL IN OUTLINE - DON’T GROUP THEM INTO A NEW GROUP!!!
0. make YOUR mesh in T POSE
set pivot point to feet of mesh
freeze transformation on mesh
erase history of mesh
IF YOU’RE. USING QUICK RIG: quick IK rig config - step by step: 2 spine units skeleton, skinning - 4 mesh influences
animate your characteer with control effectors
6.IN ORDER TO EXPORT: SELECT > ALL BY TYPE > JOINTS
7.KEY > BAKE SIMULATION
select ONLY MESH AND JOINTS FOR EXPORT - IMPORTANT!!! DON’T PARENT INTO GROUP, DON’T SELECT GUIDES, CONTROLS, ANY OTHER OBJECTS
8.1 FILE:SEND TO UNITY
FBX EXPORT SETTTINGS:
GEOMETRY: SMOOTHING GROUPS - YES
SMOOTH MESH - YES
(EVERYTHING ELSE IN THIS GROUP - NO!!!)
ANIMATION - YES
EXTRA OPTIONS USE SCENE NAME - YES
REMOVE SINGLE KEY - NO
QUATERNION INTERP MODE: RETAIN QUATERNION INTERPOLATION
BAKE ANIMATION - NO IF YOU BAKED YOUR SIMULATION BEFORE
DEFORMED MODELS, SKINS, BLEND SHAPES - YES
CURVE FILTERS - YES
GEOMETRY CACHE FILES - YES
SHAPE ATTRIBUTES - NO
CONSTRAINTS, SKELETON DEFINITIONS - YES
EMBED MEDIA - YES
INCLUDE CHILDREN - YES
INPUT CCONNECTIONS - NO
UNNITS SCALE FACTOR 1.0, AUTOMATIC - NO! (IF YOU PREVIOUSLY SET MAYA UNITS TO METERS IN PREFERENCES)
BINARY FBX 2020
IN UNITY:
SELECT PREFAB BEFORE!!! PUTTING IT IN HIERARCHY AND CHOOSE IMPORT SETTINGS:
RIG - HUMANOID, CREATE FROM THIS MODEL, STANDARD 4 BONES
ANIMATION:
IMPORT ANIMATION - YES
IMPORT MESSAGES - GENERATE RETARGETING - YES
MODEL:
SCALE FACTOR - 1
CONVER UNITS - NO - IF YOU PREVIOUSLY SET YOUR MAYA PREFS TO METERS UPON EXPORTING
BAKE AXIS CONVERSION - NO
IMPORT BLENDSHAPES - YES
SORT HIERARCHY BY NAME - YES (???)
PRESERVE HIERARCHY - NO!
MESH COMPRESION - OFF
READ/WRITE ENABLED - NO
OPTIMIZE MESH - EVERYTHING
TROUBLESHOOT YOUR ANIMATION?
CHECK THE ANIMATION IF THE ROOT MOTION IS BAKED INTO POSE ??
ALTERNATIVE TO MAYA QUICKRIG:
UPLOAD A NEW FBX MESH WITHOUT THE RIG - TO MIXAMO FOR FREE FLAWLESS RIGGING!!!
There You go - I wrote You a reply two years after you asked the question But maybe someone else will find it useful as it literally took me days! to finally figure this one thing out.