Before I begin I was told to use JavaScript for a start in case this has to do with anything.
I have a script to set up a scoring system in my game. This is the script:
#pragma strict
static var currentScore : int = 0;
function OnGUI () {
GUI.Box (new Rect (Screen.height*0.5, Screen.width/2, 200, 200))"Score";
}
I cannot test it because it wants a semi colon and it says:
Assets/GameMaster.js(6,65): UCE0001: ‘;’ expected. Insert a semicolon at the end.
Do I need two semi colons or is it something I’m missing?
Pix10
October 11, 2015, 6:51am
2
Comma before “Score”…
GUI.Box (new Rect (Screen.height*0.5, Screen.width/2, 200, 200)), "Score";
You also have a misplaced ‘)’
GUI.Box(new Rect (Screen.height*0.5, Screen.width/2,200,200),"Score");
Kiwasi
October 11, 2015, 8:16am
4
There is also little point messing with OnGUI. The new UI tools are much more powerful.
MikeUpchat:
You also have a misplaced ‘)’
GUI.Box(new Rect (Screen.height*0.5, Screen.width/2,200,200),"Score");
I tried the other way and it had a second error.
I am using a 2 year old youtube guide for my first game
Kiwasi
October 11, 2015, 9:38am
8
Why not use an up to date one, like roll a ball?
Because I can easily understand everything the person is saying in this guide and they explain everything and they do things as they go along so I learn how to code more than anything else.