Animator Control!
Before I tackle bigger projects where animations are necessary for characters, enemies and etc. I decided to work on my knowledge of animation controllers, Mixamo, Avatar masks, blend trees, and State behaviors with characters. It was a little complex, but necessary to learn about it. The characters use less code and use root motion more to move around.
It was nice to use Mixamo again, I haven’t used Maximo since about mid-2017 when setting up my rigged succubus character with certain animations.
https://sketchfab.com/3d-models/suductress-idle-animation-78137cda3da84150bdd738db7855b94b
Assets by Unity and Mixamo respectfully
WHAT I LEARNED
• Having a reference of String Horizontal and Vertical Inputs in a new Vector3 on the same line of code.
• Using a raycast starting from the middle of the character and shooting from the bottom to check if grounded before jumping, all this is set by code.
• How useful State behaviors are when you want to execute certain character animation states while using override voids with Animator, AnimatorStateInfo, and int. E.g.’ of State functions…
- OnStateEnter: determines entering the state.
- OnStateExit: determines exiting the state.
- OnStateIK: related to IK methods and events.
- OnStateMachineEnter: called on the first update fame when making transitions.
- OnStateUpdate: called at each update except for the first and last frame.
- OnStateMove: called in the root motion every time it moves (animation).
• How accessible the Animation controller is by using blend trees, Avatar Layers, and layer masks.
• Debugging the game object's name with Animator and Animator StateInfo in the console.
• Assigning a private game object on an instantiated public game object to keep track of it and then destroying it with one script all part of the State Machine Behaviour script, speaking off which….
• An alternate “mono behavior” which is State Machine Behaviour is used to call state functions.
• A bit more specific info on state machines and transitions including entry, exit, and any state.
• How smooth Exit time can be when going from the next state.
• How duration and transition duration work together to determine how long it goes to the next animation.
• How well generally the character's humanoid avatars sync really well with bones to appropriate body parts and sharing them with different character models with animations in Unity.
• How good avatars are for rigged game characters rather than generic (e.g. cube) objects moving or rotating left or right. Generic objects don't need avatars, just an animator controller.
• Animations can be mirrored.
• Foot Ik determines the accurate footing on terrain or mesh.
• How Root motion allows the animation to move into 3D space along a vector3 position in world space.
• How effective using layer masks is when controlling which limbs will be animated in between two layers.
• How I can import the 3D characters to Miximo, assign them an animation, and play around with options like arm space, trim, and overdrive.
• In Mixamo how I can download the new animated character or in a unity package, skin with mesh or without mesh.
• How you can copy a rig and create a new character model respectfully.
• How useful sub-state machines are inside state machines and can create as many as you can. It can even exit out of them to other animations.
• You can mask multiple animation layers.
• How useful blend trees are for blending multiple animations together with the use of parameters to make a new animation so that it is easy to control the character from code.
• How useful the two types of blend trees of:1D: 1 Dimensional and 2D Freeform Cartesian.
However, I find the 2D one more useful such as….
- allows blending multiple directions and speeds.
- good for controlling turn animations.
- unlike the 1D threshold, it has 2 parameters of pos X and Y threshold instead of one.
- the thresholds must be equal to the same value to run an animation.
WHAT COULD I HAVE DONE BETTER?
• I couldn’t get the characters to jump higher by animation while using root motion. I could have coded their velocity to go higher, but I wanted to keep things simple and focus on the goal: which was to learn more advanced Animation controller options.
OVERALL: I’m happy I learned a lot about Humanoid animation, it may look like a small project, but there was some complicated and advanced learning process to understand how to control character animations for my future games. This won’t be the only time I learn about humanoid animation control, this was just the start of learning the advanced tools. Stick around and you will see more of my experiments!
Comentarios