Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Enemy Attack state And Animations

Hello, this is my 4th post for this month for Team Terror Forge. This week, I focused on modifying the enemy AI for the project, specifically working on implementing its attack and chase states as well as adding more animations. The objective for these was getting the enemy to be able to attack and switch states when needed which it can as well as play the correct animations and switch animations as well when needed to. 


I encountered several issues during this process. The first problem was that the animations were not syncing up correctly. This desynchronization caused the enemy's movements to appear disjointed and unnatural, disrupting the flow of the enemy states and causing the enemy to spaz out when changing states. The reason this was occurring was because of the different blend trees I had for the animations, because I had so many different trees there were no exit timers for the animations to revert back to what it was originally supposed to be. The way I fixed this issue was by having a single blend tress and having that held all my animations and transitioned between them this of course needed the values to be manually set for the animations in code as well for it to work.





The primary issue I ran into was implementing the attack state. In my mind, I thought it would be a simple implementation I  was wrong mid-way through I ran into 2 problems the transition from the chase to the attack state and how the attack state would be triggered. I had a couple of solutions but the primary one I went with was creating an object and having that have a collider which will then get the data I need and pass it onto my manager's collider the only issue was I couldn't get that data to pass to my manager collider it just wouldn't work so I went with a different approach and that was to just use the collider I already have and use a different bool check to be the trigger for the attack right now the attack state works but not in the way I want it to this is something I'm going to have to figure out a better solution for.

Support this post

Did you like this post? Tell us

Leave a comment

Log in with your itch.io account to leave a comment.