Welcome!

Welcome to our community forums, full of great people, ideas and excitement. Please register if you would like to take part.

This is extra text with a test link..

Register Now

Announcement

Collapse
No announcement yet.

Gameover Screen help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Gameover Screen help

    I keep getting this error
    error CS0106: The modifier 'public' is not valid for this item
    how can I fix this?

  • #2
    Please post your code. Can't tell with the current description.

    Comment


    • #3
      Here it is.
      [public class EndZaGame : MonoBehaviour
      {

      void Start()
      {
      public void ExitGame()
      {
      Application.Quit();
      Debug.Log("I quit");
      }
      }


      }]

      Comment


      • #4
        In addition, the recast pistol script I'm trying to make seems to keep shooting up this error that states the file name and class name need to match. I named it exactly what it needed to be, but this error keeps popping up.

        Comment


        • #5
          You can't put a method inside another method. Right now, your line:
          Code:
          public void ExitGame()
          is inside the Start method. Look carefully at your brackets.

          Comment


          • #6
            Come visit me at my zoom room.

            Comment

            Working...
            X