BGP #4
|
Welcome back to Causality! Today I will talk about what has been accomplised during week 4! I will talk about why and how I implemented a special evasive maneuver for our game Causality. The reason we wanted an evasive maneuver was to increase the players mobility but also to help the player evade attacks and move away from enemies. So this evasive maneuver had to be something that could be used fast and move the player away if necessary from combat so we decided to use a roll for this purpuse. One thing the roll needed was invincibility frames so the attacks wouldn’t damage him in case he get hit because the player lost all control because the roll was fixed. So use invincibility frames I had to use a bool check when the player got hit and to activate or deactivate the bool I used an event when the animation had reach a point so it wouldn’t be instant turned on be to fast and turned it off before the character got out of the animation to prevent it from becoming to overpowered by making the player invincible. The event that activated and deactivated was added in the animation manager. Then I used unitys input manager to send a button press and then check in a function if you had pressed the right button. Pressing the right button activated the roll, where I had to take the input of the joysticks and change the rotation of the character to the direction that we joystick was pointing towards. Then I had calculate where the player would end up so you couldn’t change during the roll by setting the target position to a distance ahead of the player using unitys vector3 forward function and also activate a bool to prevent the player from restarting the roll during its travel. Then I coded a function where it would update the position of the player while the roll was active overtime and time it with the roll animation. The roll was active until the player had reached its target position where I ended the roll movement and timed the animation by increasing the speed of the animation so it would feel connected with the distance it had to traveled. |