Question by
iSizz · Jun 24, 2019 at 12:41 PM ·
c#scripting problem2d-platformeranimations2d animation
How to play animations from script.
I dont know why but I have one Animation file made in unity, and i want to make it work when character is walking, but its doesnt working when i press A or D.
public Animator walk;
void Start()
{
if (Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.D))
{
walk.Play("walk");
}
}
Comment
Your answer
Follow this Question
Related Questions
Cannot delay player respawn. 2 Answers
Why doesn't this script work? 1 Answer
A* Pathfinding and keep the enmy at range 0 Answers
Using multiple materials on a 2d mesh 0 Answers