R
R
ROWASTAIR2021-04-21 16:52:57
Unity
ROWASTAIR, 2021-04-21 16:52:57

How to find the previous position of an object?

I need to play animation if the object is in motion. But for this you need to compare the old and new positions, how can I determine the old position in the code, what should I write?

if (player.transform.position == "предыдущая позиция")
            {
                anim.SetBool("Walk", true);
            }
            else
            {
                anim.SetBool("Walk", false);
            }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question