- Home /
using UnityEngine.UI; results in missing semicolon error.
I'm simply trying to access the UI, but every time I type in
using UnityEngine.UI;
it gives me the messing semicolon error? Also, using refuses to show in blue as I'd naturally expect it too, so I assume that's an issue, but I don't know how to solve it. Any help?
Definitely going to need more to go on with this. Can you post more of your script?
That line is not the problem - you need to post your complete script.
Answer by Trevdevs · Jun 28, 2017 at 07:02 PM
Javascript doesn't use using as the keyword for dictionaries man, change using to import. I don't use javascript personally but im pretty sure you don't even need this line it comes with the library automatically i think may be wrong though :) cheers!
from
using UnityEngine;
to
import UnityEngine;
Answer by NerdRageStudios · Jun 27, 2017 at 02:38 AM
Are you sure you dont have syntax errors somewhere else in the script?
Yes, all problems go away when that text is removed. The error also definitely points to the line it's on.
Please post the beginning of your script up to the point where you class declaration starts.
Answer by jaxsonp10 · Jun 28, 2017 at 06:35 PM
In an attempt to make absolutely sure there are no other syntax errors, I made a new script, and here is exactly what's in it:
#pragma strict
using UnityEngine;
using UnityEngine.UI;
function Start () {
}
function Update () {
}
This is a band-new script, all I added was the using commands. Both the using UnityEngine and using UnityEngine.UI throw that exact same semicolon error.
Your answer
Follow this Question
Related Questions
gui text button dont work 1 Answer
Need help with GUI and raycast...and gameobject I click on, I get the GUI to show up. 1 Answer
Rotate Texture 1 Answer
Paper, Rock, Scissor 3 Answers