I am getting an error that says Unexpected symbol ‘if’ and also another of the same errors but Unexpected symbol ‘scoreText’. I don’t understand how the first one can be wrong because there is another line just like it as you can see and there is no error for that? Not sure what to do
Your missing a semi-colon ( ; ) at the end of some lines.
Whats that error say?
It says that
when i put the ‘)’ behind ‘Time.deltaTime’ it gives me an error at line 30
You’re using ( ) in certain places where you should have { }. The different kinds of brackets/braces/parens are not interchangeable. In that code the ones by themselves on the lines are the ones that should be { }
Also, you can copy/paste script and error messages, it’s much easier than screenshots. Wrap them in code tags
to preserve formatting, etc.
wow, thank you! that worked! what would you do about NullReferenceException errors? alright i will do that next time!
it says i have 999+ of them but they don’t effect anything they are just there?
Ok so, null reference means that some variable your trying to assign something to doesn’t have a value yet.
This means somewhere in the code your creating variables like “GameObject someObject;” and at a later point, your doing something like “someOtherObject = someObject;” and it can’t assign anything, because someObject wasn’t assigned to an actual gameobject yet.
Sounds like you should hit the learn section stat.
That’s incorrect. That line will function just fine; it will simply assign someOtherObject to null.
A NRE will happen if someObject is null and you try to do something like someObject.transform.position = Vector3.zero;
If you’re seeing hundreds of those errors, then a line akin to the above one is happening in an Update somewhere; if you double-click in the console it’ll take you right there.
Oh right, good point! Maybe I should go through the learn section again haha
Hm, so I’m new to this so i kind of follow but not really? Its happening in an Update somewhere? do you mean like ‘void Update’ or something?
Yes, that’s what I mean. Like I said, double-click on the error in the console, and it will open your script editor to the line that is causing the error.
i see, but the problem is its just taking me to the lines 27, 29, and 34 from the screenshots, also i tried rapping [code ] but I’m afraid i don’t know what you mean by that either.
you have discord? you can explain to me on there
I don’t do one on one support unless you’re paying.
It’d probably be worth your while to go through the scripting tutorials.