- Home /
Question by
Sarti · Feb 03, 2014 at 03:51 PM ·
movementscript errorspace shooter
Scripting errors I don't know how to fix! Can anyone help?
unityscripterror2.jpg
(445.9 kB)
Comment
What have you tried? The first error tells you that line 17 is using a variable that the compiler does not recognise. That's a pretty straightforward piece of advice. If you are not familiar with c# then you'll need to get some help with that so head over to:
http://unity3d.com/learn/tutorials/modules/beginner/scripting
Best Answer
Answer by robertbu · Feb 03, 2014 at 03:56 PM
'moveHorizontal' and 'moveVertical' are never declared. You can just add 'float' at the front of lines 17 and 18 to fix the problem.
float moveHorizontal = Input.GetAxis("Horizontal");
float moveVertical = Input.GetAxis("Vertical");
Note for futures posts, don't post an image of your code. Instead past a copy of the code into the question, select your code, and use the 101/010 button to format the code.
Your answer
![](https://koobas.hobune.stream/wayback/20220613132426im_/https://answers.unity.com/themes/thub/images/avi.jpg)