KybernetikGames / animancer

Documentation for the Animancer Unity Plugin.
63 stars 8 forks source link

What is the best way to play attack/skills animation for 8 Directional Sprite Setup ? #327

Closed danyLarge47 closed 6 months ago

danyLarge47 commented 7 months ago

Hi, I want to make a top down Action RPG game using 8 direction sprite, I look at this plugin because how modular it is. But I cant seem to make a custom animation for attacks and skills play nicely, here's what I did :

https://github.com/KybernetikGames/animancer/assets/125122286/1dd22ac1-6c8b-444f-b0d2-62b25ba1a78e image image

The AnimateCharacter method is called on update, the result is a bit weird, because if I spam the method, it can pass through the bool check, and can return false even when the animation is still playing.

image

I also got this warning, what is the recommended way to play an action/attack animation for the 8 directional setup ?

KybernetikGames commented 7 months ago

The first two Play calls in AnimateCharacter look unnecessary since the last one is doing the same thing and would replace them anyway.

If you're only using those transitions on a single character, then you can safely disable that warning. Otherwise you would likely need to Manually Copy the events before assigning the end event to avoid having all the characters share the same event sequence and therefore trigger each other's events. That could be the cause of the inconsistency in tracking whether or not a particular character is performing an action or not.

danyLarge47 commented 7 months ago

Hi, thanks for pointing out the first walk/idle condition, didn't realize I use them twice like that.

The manual copy events works really well for my case, the event flow is working correctly now, Thank you :)

image