Monday, March 18, 2019

This Week's Progress in Unity

This week I created a camera controller, re-parenting several components of my character game object's hierarchy in the scene:



Earlier, the camera was parented inside of the character, and all of the components including scripts were on the outermost object in the hierarchy. Now, there is a parent null object underneath which the character rig and camera reside in two separate game objects. The camera is now parented underneath a null object resting at the pivot point of the character, (0, 0, 0) in local space.



It's nice that my character now has a decent camera controller, however, his functionality is now suffering from a few bugs. First, the character rotates downward after moving. This is because I set the characters transform.rotation to be equal with that of the camera, and the camera is looking downward. I will have to find a way to rotate the character back up so on the x axis so that its forward vector is parallel with that of the world's.   

The second, I think, is due to the re-parenting I did of the camera and character controller, because the colliders are no longer working, so the landing animations no longer play. I will re-parent the camera, and apply the animator component and all other scripts and components to the top/root level of the hierarchy.

The last issue I have to fix is that the IK aiming is also malfunctioning, flickering instead of staying constant. The left hand is no longer moving to the position of the ik handle on the rifle. I don't know why this is taking place, but the issue started when I re-parented the camera controller object, if that is any clue. 


I have started to build the functionality for the character's melee system. There is a null object that the left-hand IK handle snaps to when it is toggled active. Right now it's a bit choppy, but I will use this to give my character the ability to strike at targets, his fist automatically moving to contact. I will need to figure out how to achieve smooth blending from null objects to IK handles for all Unity IK functionality in order for the animations to be believable.

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: