- Home /
issues with animation :(
hia, im still new to Unity and im having some problems. I made a walking animation for my character in first person so it looks like hes walking. It moves the player camera up and down to give a simple "walking" look and for some reason it wont play when i walk like its supposed to. The script is:
pragma strict
function Update () {
if (Input.GetButtonDown ("Horizontal"))
{
animation.Play();("walking");
}
}
And i get this error:
Assets/walking_and_running.js(8,27): BCE0034: Expressions in statements must only be executed for their side-effects.
I have tried to find out what this means but i cant. I have the script and the animation both put in the Main Camera of the player. Also, when i set the animation to auto play to test out how it looks, the animation only flows once and it pushes the player into the ground.
Please help and thanks :)
Answer by supernat · Aug 23, 2014 at 06:56 AM
animation.Play();("walking");
should be
animation.Play("walking");
Your answer
![](https://koobas.hobune.stream/wayback/20220613161252im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help Solve This 2 Answers
what is the jump axis for if (Input.GetAxis(" ? ") 2 Answers