|
I have no idea what is wrong with this I am trying to get a GUI to pop up giving the player a choice to either go back to the main menu or continue with the tutorial. So I put in the code for it and it gave me three errors that when I do what it says it adds even more errors. Please help because clearly I have no idea what I'm doing so if anyone does help could you please explain what I did wrong thoroughly. Thank you //This script creates a lap counter that once it reaches 3 it will restart the level
var score:int;
function OnTriggerEnter(other : Collider){
if (score
(comments are locked)
|
|
As @GC83 said, you can't redefine OnGUI inside anoher function. In order to control the GUI, you must have a boolean variable that enables / disables the code inside OnGUI:
var score:int;
private var guiEnable = false;
function OnTriggerEnter(other : Collider){
if (score
(comments are locked)
|

You have chosen an awful name for this topic posting.
I see one of your issues. Youre nesting a function within an else statement. You cant do that, especially a Unity predefined function. You cant place OnGUI() within OnTriggerEnter(). Separate them and see what happens.
@kolban is right: this name means nothing! Edited your question and added a more meaningful name.