torsdag 2 mars 2017

5SD064 Animator Controller.

Animator Controller.


Hi i'm Kevin from team Fenrir. I'm one of the programmers in my group and also the lead sound person. This week I have been working with switching between animations on the player. I have been doing this because me and my team wanted to have animation for the player walking and since the artist of our group is done making the animation sprites I am now implementing them. Before this I had only been putting in animations for objects that only have one animation. So I have been learning to use the animator controller in Unity.

So the player has animations for walking up, down, right and left. when I started doing this I thought that all you had to do was write in the script to play a certain animation at specific times but this could not make the player switch between animations. The way you actually have to do this is assigning triggers, floats, ints or bools for transitions between animations. I decided to assign floats for the transitions which are like if statements outside the script. In the script I assigned the float for the transition to my "Input.getAxis" floats by using the "SetFloat" command. So now when i'm using these transitions the animations do switch but not very properly for some reason the player switch to the ideal sprite from time to time at moments where it shouldn't, but i think this has to do with the pattern of my transitions. It's also possible that the problem would be that the "Input.getAxis" float is the wrong variable to assign the transition to. Maybe I have to assign it to "Rigidbody.velocity" or something.


Now in the last couple weeks of our projects our game is really coming together but I still have to make these transitions work and some minor fixes from our feedback on the play testing session we had on Monday. Next week i'm going to have to make it so that the player can tackle the enemies and a better visual feedback for when you lose health, but before that i have to wait for some sprites to be done by the artist in our group.