D
D
darkkrogonk2016-06-04 04:00:55
C++ / C#
darkkrogonk, 2016-06-04 04:00:55

How to set transition from one animation to another unity?

The character has 2 animations, a state of rest and a state of running, how to make them switch between each other? or rather, you need a script to switch

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Pavlov, 2016-06-04
@darkkrogonk

There are three excellent tutorials for creating animations:
Fundamentals of creating a 2D character in Unity 3D 4.3. Part 1: character preparation and rest animation
https://habrahabr.ru/post/211472/ Part 1: character preparation and rest animation
habrahabr.ru/post/211847 Part 2: running character
habrahabr.ru/post/212309 Part 3: jumping (and falling)
The version of Unity is old, and some things will have to be changed in the code - first of all, add
a reference variable to the rigidbody and initialize it in Start ():

private new Rigidbody2D rigidbody2D;
void Start()
{
    rigidbody2D = GetComponent<Rigidbody2D>();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question