Posted June 18, 2024 by Mythic Mana Games
Hello. Ricardo here.
Recently I've made a series about everything that has gone wrong with animations using Unreal Engine 5. Having become enlightened, I'm trying to have fun with the game while making it instead. I've changed the narrator in my head and I've decided to make another series about things that have gone right instead.
Focus on the good, rather than the bad!
Recently, I changed the way our attacks are handled, or rather their colliders. We used to handle it with the weapon, having a collider turned on and off when attack was called. We were trying to attach it to the weapon, but this resulted in many bugs like the character hitting himself as well as the enemies... And did I mention, MULTIPLE HITS?
Yes, the player was so overpowered, he damaged himself in the process of killing his enemies, but don't we all hurt ourselves in the process of hurting others? Let's tone down the realism.
Even though we hard coded the whole process and fixed every bug, it never felt right. When I started to introduce abilities on the player, I knew it was time to find another way and so came Animation Notify and Notify States.
I wrote code for the player to spawn sphere colliders with every animation attack performed. Basically, you set up your own Anim Notify State and use this to handle the frames in the animation where the attack is happening. Then set your Anim Notify just to notify when your animation is done, in your terms.
Something I've always loved about coding is that if you can picture it in your head, you can make it happen.
You are the creator God of your game, anything is possible.
NEVER forget that!
By Ricardo Rodríguez (06/17/2024)