I had "Apply Root Motion" unchecked. That was causing some problems as we saw before. There were two main problems that I was having when apply root motion was checked, First, the camera would spin like a carousel around the character when running and moving the mouse too fast. When this would happen, I was unable to stop the camera from spinning with my mouse, and had to wait for it to slow down and stop. This could also be due to not having a proper camera controller script. I will need to revisit this and create a proper camera controller script. The second problem I was having was that over time, the character would rotate inside of controller, offsetting it's rotation from the camera in 3D space, which is also very problematic. Lastly, as we saw before, when "Apply Root Motion" was unchecked, I was getting problems with the sprinting animations looking dorky, possibly because they aren't blending properly.
In order to be able to check apply root motion, I had to do a few things, including deleting and re-importing most of my animations, with only the root translation zeroed out, will explain this later.
There is another reason why I spent a lot of time re-organizing my project. I have a lot of animations sitting on my computer, things I have purchased from places like the Unity Asset Store or Humble Bundle in the past, been drawing from many of those instead of just my MoCap. In order to go completely from MoCap, I would have to shoot a lot more MoCap, effective time management. My project had all of my animation libraries imported into it because I wanted to be able to preview them all. There were way too many animations, slowing things down, project is too big, can't move it from home to school computers. So, I separated them into 2 projects, one for previewing my animation libraries, the other for bringing chosen animations in and building functionality.
My animation preview layout:
There were way too many animations to just be sitting around in one Unity project unused:
I also worked on importing .fbx animations successfully from Blender. I found this video very helpful, from 7:35:
https://www.google.com/search?q=how+to+export+blender+animations+to+unity&rlz=1C1CHZL_enUS798US798&oq=how+to+export+blender+animations+&aqs=chrome.1.69i57j0l2.12989j0j7&sourceid=chrome&ie=UTF-8#kpvalbx=1
First thing to do is make sure all bones are selected in Pose Mode, not just the root bone or the armature object:
Next, these boxes need to be checked when exporting, all except "Force Start/End Keying."
For some reason, Blender doesn't like MoCap rigs or Vicon FBX format or something. Other rigs work, but when I try to export Vicon Blade MoCap animations/rigs from Blender to Unity, it breaks. I will need need to Use Motion Builder for those.
After that, when I have re-imported into Unity these check boxes need to be checked (all except Loop Time and Loop Pose):
The reason why these 3 check boxes need to be checked is to avoid the root rotation being applied to the character, which was causing him to rotate around in 3D space in the Unity engine.
So, sorta taken 2 steps forward, 1 step back, but it is for the better.
The reason why I deleted all of the animations from my project, zeroed out the root transforms, is so that I can check apply root motion, which fixes the problems I was having with blending between the running cycles, and also allows me to apply the root motion for some certain animations which will not be completely zeroed out on a single axis moving forward. This helps add the impression of motion to moving character so that it doesn't look like it's rolling in place while being translated on it's z axis. This is also good for me to know in case I need to use apply root motion in the future.
I also got jumping to work, but there are no animations applied, yet.
So the current state of my project is that I am still zeroing out root translation of the characters to the world origin. Once that is complete, they will be easy to add in because everything (state machines, animator, scripts, etc.) is still there.
Next week I will work more on fleshing out my character controller, adding more functionality. including falling and landing.
No comments:
Post a Comment