KybernetikGames / animancer

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

Animation Weight - Character Breaking #347

Closed wrymn closed 3 months ago

wrymn commented 3 months ago

I am using 3 layers to animate combat of our units.

[0] base layer for idle, walk, run (always playing) [1] combat layer, for combat idle, walk and run (playing when only in combat) [2] action layer, just for combat attack animation (playing only during attack animation, once every 2s for example)

the issue is, when combat attack animation is fading out from weight 1 to 0, the character is going under ground. Then when it reaches 0 and attack animation stops playing, the combat idle on layer 1 takes effect and everything is fine.

Is there something that I'm doing wrong? You can notice, as long as action layer 2 is at weight 1, its fine

image

but you can see when I set it to low value, the entire unit breaks and goes under ground

image

I am using Humanoid Avatar, this is the animation clip setup:

image
wrymn commented 3 months ago

Figured it out, I was fading out just the state, but the layer still had weight of 1. Fading out entire action layer solved the issue.

KybernetikGames commented 3 months ago

Yeah, fading the layer is correct. You would think they'd be mathematically the same, but layer mixing uses a completely different algorithm from state mixing.

Animancer v8.0 will have a warning in the Inspector about this.