A
A
Azamat2020-06-11 15:51:05
Unity
Azamat, 2020-06-11 15:51:05

I'm animating a character in Unity 2D, but there are no animations, what should I do?

Plz tell me how to do it. There are no animations, although I animated the character, maybe I missed something else?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
super-boy-vasek, 2020-06-11
@super-boy-vasek

5ee2568e76fcd272501871.png5ee256b166b44435602336.png

M
Maxim, 2020-06-12
@XTerris

Each transition (arrows between animations) must have conditions, for example, a variable dependency (speed > 1). Ho, to use a variable for a condition, you need to create it in the parameters tab, these variables are set from scripts

private Animator animator;
private Rogidbody rb;

void Start() {
    animator = GetComponent<Animator>();
    rb = GetComponent<Rigidbody>();
}
void Update() {
    animator.SetFloat("speed", rb.velocity.x);
}

Naturally, bind the script to an object that has rigidbody and animator components

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question