erazem jezersek
erazem jezersek

Reputation: 1

I am having a problem with blending my animations played by script ( animator.Play(newState); )

I am working on animating my character so it can go in all 8 directions sprinting, walking, crouching, jumping...

First I was using the animator transitions and parameters, everything worked fine, I were switching only parameters with my script, but it was getting way to messy, with to many transitions.

Then I switched to playing the animations directly from the script, using the GetComponent<Animator>().Play(wantedState);. However this does not blend animations and I don't know how to.

If anyone has any idea - I would appreciate any help. Thanks.

I have tried putting any other word instead of play, such as Fade, but nothing worked.

Upvotes: 0

Views: 86

Answers (1)

derHugo
derHugo

Reputation: 90813

Instead of using Animator.Play which hard jumps to the indicated state you are rather looking for Animator.CrossFade

Creates a crossfade from the current state to any other state using normalized times.

Upvotes: 0

Related Questions