Devlog 3 : animations and enemy ai


This week the game combat has taken shape. With our newly imported player model from last week we have created an ensemble of player animations as follows. -Idle -Walk

-Sprint

-Roll

-Light Attack

-Heavy Attack

-Special Attack

Along with these animations the player combat script has been updated with attack triggers which play the attack animations while also affecting values in the player movement accordingly. Such as stopping the player moving while performing an attack. 

Also added in this week was the enemy pathfinding and detection code. The pathfinding and movement code for the enemy uses unity’s NavMeShAgents. The enemy detection uses a combination of calculating player distance and then using raycasting. In layman's terms, once the enemy is within range of the player the raycast system is active, if the raycast hits the player then the detection code will tell the pathfinding to move towards that position. A few other features added onto this is the “last seen” and “chase” code. What this does is the enemy will move towards the position that it last saw the player, this way the enemy cannot track the player around walls. The “chase” system will track the amount of time the enemy is following the player, if it exceeds the time limit the enemy will return to their original position after waiting at the “last seen” position for 5 seconds. Lastly the enemy model and animation rig were implemented. Only four basic animations were needed for the first enemy, idle, walk, attack and death.

Get First Spawn

Leave a comment

Log in with itch.io to leave a comment.