Saturday, March 23, 2019

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:










All Updated Scripts--Remaining Scripts

This is the script that controls the rotation of the camera around my character:



Lastly, this script controls the muzzle flash on my character's weapon, nothing fancy:




All Updated Scripts--Movement Controller

This is the script that controls all of my character's movement in 3D space, translation, rotation, and forces being applied:





All Updated Scripts--IK Controller

This is the script that controls all of the IK functionality in my project:


All Updated Scripts--Animator Controller

This is the script used to control the playing of all animations in my project:







Friday, March 22, 2019

Demo Video Presentation

This is my presentation, showing off my project thus far, all of the state machines, briefly going over how I utilized Unity IK to create all of the functionality in my character controller in this project:


Part 01


Part 02


Part 03


Part 04


Part 05

Project Roadmap


Well, here is what was completed, and what was not. Accomplishing all of these tasks in such a short time frame was overzealous anyway. I will take the concepts I learned from this into future game projects. Unity Mecanim is very powerful for creating character controllers and correcting animations. Utilizing it will be a great asset if I follow through with it.

Presentation Slides--Pipeline







AIM IK Fix and Hand to Wall IK

I have made many adjustments since my last post. I fixed the foot turning animation on the lower half of the body, it now only plays when player is in idle, standing still, and looking left and right. I fixed aiming, it only activates when the player is shooting, to avoid the awful sideways over-bending of the body, and the twisting and contorting that was occurring earlier. The Aim IK weight is set to 0, unless player is firing and strafing. Next, I added a muzzle flash effect from the asset store, to highlight the presence of the character's weapon in 3rd person view, since it isn't easily visible. I added a coroutine in the script to give short delay so that player character isn't firing before the weapon is fully raised.


Finally, I have successfully built the functionality to get the character to detect and touch a wall on his left with his offhand using a raycast and IK! There is still a minor problem, since the hand doesn't make direct contact with the wall. Still, this lays the foundation for all other wall-touching actions on my task list such as creating friction while falling and ledge grabbing. However, I don't think I will get to ledge grabbing, that'll be a bit tricky, but friction while falling is worth a try! This may also pave the way for me to troubleshoot foot planting, since they both use raycasts and animation curves to blend between IK and an animation.





















Above, we can see the raycast detecting the wall and causing the animation to play. On the right, we can see the original animation in the inspector, and a curve above it. This curve is what sets the weight for blending between Unity IK and the original animation.

Thursday, March 21, 2019

Aiming System--Unity IK


Aiming is almost completely implemented, but is acting strange because of how the character controller and look IK conflict when they control the character. Foot planting is taking a hiatus--for now.

We can also see that turning animations play on the lower half of the body if the character is turning. This acts strangely if the character is moving around. If I keep this feature, then I will script the necessary lines to prevent that. See the extra layer added for lower body, and it's corresponding weight.

Here is the updated IK Control script in the inspector, showing the parameters that have been added for controlling the look IK.



I will have to play with these in the script, or the character controller itself in order to resolve the issues.

Foot Planting

I have been working on getting foot planting working. I have come much further since my last attempt at IK foot planting, but I am still not quite there yet. Before, I could not get it working. Then I got some jittery collision with the ground. Now, the feet are stuck down at all times, even when airborne, which is not desirable either.


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: