x


whats wrong with this code for a menu

using UnityEngine;
using System.Collections; 

public class MenuObject : MonoBehaviour
{ 
    public bool isQuit = false;
    void OnMouseEnter() 
    { 
       renderer.material.color = Color.red;
    }
    void OnMouseExit()
    { 
       renderer.material.color = Color.white;
    } 
    void OnMouseDown()
    {
       if(isQuit)
       {
         Application.Quit() 
       } 
       else
       {
         Application.Loadlevel(1) : 
       }
    } 
}

i keep geting a parsing error and a unexpected symbol '}'

more ▼

asked Jun 14 '11 at 03:51 PM

gamedesigner43 gravatar image

gamedesigner43
-14 6 6 6

Learn to format your code.

Jun 14 '11 at 03:53 PM almo

OK we have solved the unexpected symbol but i keep geting this Assets/Standard Assets/MenuObject.cs.cs(4,1): error CS8025: Parsing erro

Jun 14 '11 at 04:07 PM gamedesigner43
(comments are locked)
10|3000 characters needed characters left

3 answers: sort newest

A tip: double click the error message, and you will be the line whick contains the error.

more ▼

answered Jun 14 '11 at 04:37 PM

onevcat gravatar image

onevcat
1 3 3 4

(comments are locked)
10|3000 characters needed characters left

You need a ';' after LoadLevel and a ';' after Application.Quit(). These were easier to spot after I reformatted the code for you.

more ▼

answered Jun 14 '11 at 03:58 PM

almo gravatar image

almo
1.7k 2 6 18

(comments are locked)
10|3000 characters needed characters left

You have a : instead of a ; after your Loadlevel command - which should also be LoadLevel.

more ▼

answered Jun 14 '11 at 03:52 PM

willgoldstone gravatar image

willgoldstone
285 1 1 6

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x36
x17

asked: Jun 14 '11 at 03:51 PM

Seen: 603 times

Last Updated: Jun 14 '11 at 04:37 PM