- Home /
How to make root motion in cat .fbx drive movement?
I've been playing around with the 'new' Sample Assets Beta, in an attempt to teach myself the new best practices, Mecanim and driving movement with animation from my modelling program (in this instance, Blender).
I'm about done with the rigidbody character controller scripts (conclusion: very interesting, but wayyy more complicated than you need to prototype and make a small game, especially for one person), I've developed some respect and maybe a sneaking fondness for Mecanim... but I can't seem to make my cat model move with root motion.
I've turned on 'Use Root Motion', turned it off, tried driving it through a script (OnAnimatorMove()), baked the rotation, translation in Y and XZ, unbaked it, based the calculations on original and root bone and and and AND--
THE DAMNED THING WON'T MOVE FORWARD (one animation) WHEN I USE THE INPUT AXIS! It just plays the walk-forward animation and stands still. Meanwhile Ethan and his hipster glasses and stupid frosted hair gads about like a cherub on pcp.
Can anybody provide me with a clear explanation and/or example of what I'm doing wrong with this project? [Prefab with cropped assets from Sample Assets Beta, my test cat w/animation, Mecanim animator and test scripts enclosed.][1]
G'wan! Deliver a Christmas Miracle! =D
--Rev [1]: https://dl.dropboxusercontent.com/u/53322618/CatTestParent.prefab
Sorry this didn't come in time for Christmas, but did you try following the excellent tuts on the animation learn page?
http://unity3d.com/learn/tutorials/modules/beginner/animation
If you still have trouble moving the cat after following these - submit a repro scene vie the Unity bug reporter (prefab does not contain the mesh or everything needed to see the issue unfortunately) and drop the reference number here
A belated response: Good suggestions! However I assume I've screwed something up with that model, so will be approaching the issue afresh with... A CUBE! Thanks. =)
Answer by meat5000 · Jan 16, 2015 at 12:03 PM
You have two options.
1) Make your model move forwards in Blender.
2) Refer to this http://docs.unity3d.com/Manual/ScriptingRootMotion.html
Thanks man - sorry about late response! I had tried 1) and read 2) many times over... but ultimately I've decided to start from scratch. All the best!
Ok thats fair. Care to Dropbox your old model so i can take a look?
Sure, but keep in $$anonymous$$d that this was my first attempt at modelling a cat and my first quadruped animation. Assume they're crap. I also habitually export from Blender as FBX, so this isn't the exact version that's in the game. I assume you'll have no trouble exporting, though.
Here's the model: https://www.dropbox.com/s/jms44u8nauvi7gu/catRoughSizes01005Rev.blend?dl=0
And here's where it's being used: https://dl.dropboxusercontent.com/u/53322618/230115%2000.56/230115%2000.56.html (assume everything's at an incredibly early, programmer art, 50% of systems set up stage)
I'm happy to consider the issue closed, tbh. Am much more comfortable with Rigidbody now, and I figure I should just attack root motion with a cube. That said, if you can espy the mistake in my work, please let me know. =)
EDIT: It suddenly occurs to me that you may not be working in Blender! Weird. Here's a link to the exported model from the project: https://www.dropbox.com/s/vrmx8gxrfbdpq2x/catRoughSizes02001Rev.fbx?dl=0
How come there's two meshes in the file? :)
Even if visibility is disabled in Blender the mesh will still export to the FBX. I have a feeling that in Unity you are observing the static mesh ins$$anonymous$$d of the other low-poly, rig-bound mesh.
Excellent question! The more complex cat mesh was one I used for reference when I was trying to get to grips with feline anatomy.
However, when I export via FBX to Unity I use the 'selected' option in the FBX exporter (with armature and child cat selected). Exa$$anonymous$$ing the cat in the Unity Editor reveals no trace of the second cat - only the cat that I created can be found, which animates in the Inspector (import animation view) and in the world.
It just doesn't move!
Thanks for the efforts, $$anonymous$$eat! Any further thoughts?
Your answer
Follow this Question
Related Questions
Vertical root motion and rigidbody / character controller 2 Answers
Unity Root motion Offesets object on Y axis 0 Answers
Mecanim x and z plane root motion not working when importing .fbx, but works with .blend 2 Answers
How does the Animator drive Rigidbody with root motion (in detail)? 1 Answer
humanoid animation trigger root motions also on child on 2020 0 Answers