KybernetikGames / animancer

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

Layers and State Machines? #351

Closed hrachid12 closed 3 months ago

hrachid12 commented 3 months ago

Recently purchased this asset and have been loving it so far. However, I am having trouble figuring out how to use layers with Animancer's FSM, and unless I've missed it, I haven't been able to find an example that utilizes both. Can someone point me to an example of this? Appreciate it!

KybernetikGames commented 3 months ago

Unfortunately, I've never worked on a system which required that sort of thing so I don't have any first hand experience in how to do it well, but I would start by making a script like LayeredAnimationManager in the Dynamic Layers example, then have all your other scripts interact with it instead of directly with Animancer.

hrachid12 commented 3 months ago

The reason I'm trying to use layers is because I have my character in a running state and I left click to attack, it changes to that state, however the legs don't look right since the character is still moving but the characters legs don't reflect that. I figured that I could use both. So is my best bet to not use a FSM? Are there any cons to not using one other than I may need to track state myself?

KybernetikGames commented 3 months ago

Have you considered having a separate FSM for each layer? I don't know how effective that would be, but it would more resemble what you'd see in an Animator Controller.

The only purpose of a FSM system is to manage your states so if you think Animancer's implementation is getting in the way of what you want to achieve then you should definitely consider doing it another way.

hrachid12 commented 3 months ago

I'll give that a shot. Thank you!