Hello, please post code as text between code tags.
If you install the Unity extension for Visual Studio, your errors will easily be pointed out by the code editor itself.
Use single quotes for text, not backticks, give your class properties and methods a private or public label
It’s pretty obvious to see that you have closed your class on line 18, so your entire Update method is outside of the class.
Take the }
from line 18 and put it on line 37 instead.
Also:
- Next time post your code in code tags, not as screenshots.
- You are probably going to run into issues with your class as you should not be keeping it as NewBehaviourScript.
- Fix your indentation, as at the moment it is rather awkward to see which
{
goes with which}
. - When you want help with errors, tell us the whole error message(s) as the codes are the least important part of the entire error.