Saturday, 12 March 2016

Coding - Golem Model and Animation Setups - John Howard

Task

Import the low poly golem model and set it up to work with the AI scripts.

Stage One - Golem Model

Importing in the Golem was the easiest part our animator had already attached the rig to the model so when it came into unity it was all set up. The only element I had to change was to make the rig humanoid. I think in future custom rigs would be better specially for creatures however this was one of the first rigs our animator had done and it works really well.

Stage Two - Animation and Animator

Bringing in all the animations so I has access to them seemed like the logical first step. I had to change all the import settings to act on a human rig again and the import for movement animations to looping. I then had to create a custom blend tree. I used my original iteration of the ethan AI to work this out. However we didn't have as many animations as needed to create a smooth movement. I shall ask the animator of the group to create some shorter or even stationary turns. But the blend tree works really well for the first animated setup! In regard to the actual animator setup all I did was make the movement into the entry state and then the same bools from the the cube AI with a combat state which had no movement and the two attacks coming off that.

Stage Three - NavMeshAgent to Animation

The next step was to get the golem AI to use the animations in the level. To do this I have to try and take values from the nav and feed them into the animator. I have two floats currently within the animator which control the movement blend tree. Turn which is the x value, and Forward which is the z. I was really struggling with how to set this up. So with the tecaher's assistance we went with  making each float equal to nav.velocity.x/z. Now whilst this works its rather buggy the AI spasms out quite a lot due to this and even has trouble stopping so I will have to research more into this and come back and develop a script just for this nav to animator conversion.

No comments:

Post a Comment