Thursday, March 21, 2019

Bug Fixing

I realized that in the Animator window, clicking on the animation in question and ticking the "Foot IK" checkbox helps eliminate foot sliding during animations. Of course, there is still some foot sliding during the transitions, but that is unavoidable.


I rewrote my IK Solver, it still didn't work. For some freak reason, the IK locators are not obeying parenting conventions all of a sudden. This can be seen in the previous post where I show that instead of punching or aiming in front of himself, the character is punching in different directions as I move him around, because the IK locators seem to be in world space, rather than local space, relative to the character.

It may be related to how the character is picking up the camera's rotation whenever the W or left mouse keys are pressed. However, this does not make since, since the IK locators are parented to the character's rig, beneath the object that is rotating with the direction the camera is facing. I have to find a way to automate all of the IK handle's positions, or I may have to abandon IK for the remainder of this project. If I do the latter, I will later evaluate how to properly use Unity IK, and just focus on getting as many animations in as possible and using animation layers.

Another option is to keep the parenting of the camera and character controller and all components, but revert to how the camera and character rotation was originally being controlled (in the scripts). Right now, the camera rotates around the character, and the character only faces where the camera is if being moved with one of the W,S,A,or D keys, or when the left mouse button is pressed. Originally, the mouse was controlling the rotation of the character on the Y axis (horizontal).

I feel like I am finally getting to the point where I am grasping and understanding Unity IK, that is, how the IK C# functions work, what they are doing, and how to use them. However, there are still things that I do not understand.

No comments:

Post a Comment

All Updated State Machines and Blend Trees

These are all of the State Machines and Blend Trees that I set up for my character in Mecanim: