- Home /
Function not valid macro
what does this mean? "function not valid macro" thats an error im getting.
heres the code
Function update () {
if (input.GetButton("Forward")){
transform.Translate(transform.forward * moveSpeed * Time.deltaTime);
}
}
Answer by FLASHDENMARK · May 31, 2013 at 07:58 PM
function Update () {
if (Input.GetButton("Forward")){
transform.Translate(transform.forward * moveSpeed * Time.deltaTime);
}
}
Change 'Function' to 'function', 'update' to 'Update' and 'input' to 'Input'.
Remember that nearly every word in programming is case sensitive, therefore you have to be careful about getting your upper- and lower cases right.
Also, be consistent...for your own stuff, always use lowercase for variable names, and uppercase for functions and classes. That's the Unity convention and it makes code more confusing if you have a random mish-mash of upper/lowercase conventions.
Thanks that helped but im getting a problem where I cant move left or right where a guy in the video I watched could heres the link maybe you can tell me whats going on?
Your answer
![](https://koobas.hobune.stream/wayback/20220613103305im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Change Automatic to Semi-Automatic 1 Answer
GameManager trying to access method from deleted GameManager via the InvokeRepeating() function 0 Answers
error CS1525: Unexpected symbol `(', expecting `)', `,', `;', `[', or `=' 2 Answers
JavaScript Error 0 Answers
How to have OnGUI element in a OnTriggerEnter function? 3 Answers