Wednesday 27 January 2016

CGA Gameplay and Interactivity - (Group Project) Walking animation and attack animation.

So some of my group mates have done the finished version of the walking and jumping animation for the main character while another started making rough sketches on the melee attack animation.


One of my group members as also done the final version for the slime as well as the animation for it to bop up and down.


Now onto development wise, I have put these into our game and also set up a animator for our character to play certain animation depending on what is going on.



I have reposted the player script to help with what I'm going to talk about. I made the speed of how fast the player is moving a float, so in the animator tab I make a float there as well and called it Speed and made it 0.0.

Then as you can see above there is a connecting coming from the Idle State to the Run state.In that sate I have made it so if the speed is more than 0.1 the running animation would play.








I can use the same thing with the jumping but instead of making a float I would use a bool determining if it is true or false whether the player in on the ground or now. So can check that by having a GroundCheck under the player which is the child of the player whether it is touching the ground or not.



After putting all the animations together and getting it working, I decided to move onto doing the attack animation as well getting something to take damage from it.

I made 2 scripts one called attacking which is then put onto the player , this is just for the cooldown for the attack and a bool to get the animation working. As well pressing the "f" button for it to pay the animation and deal damage.


second script is pretty simple, it just applies the damage when a object tagged as "enemy" as well as it being in the attack trigger will take 20 points of damage. This script is put onto the Attack Trigger which is a child of the player.



As of yet everything works fine but we don't have a enemy that can take damage as of yet, which what I'm hoping to get done next.







No comments:

Post a Comment