- Home /
Question by
Zanyblax · Sep 13, 2015 at 09:42 AM ·
c#noobplaypause menuidentifier
Identifier Expected: Public is a keyword
What does this mean?
here is my code:
using UnityEngine;
using UnityEngine.UI;// we need this namespace in order to access UI elements within our script
using System.Collections;
using UnityEngine.Internal
public class pause : MonoBehaviour
{
public Canvas PauseMenu;
public RawImage PauseScreen;
void Start ()
{
PauseMenu = PauseMenu.GetComponent<Canvas>();
PauseScreen = PauseScreen.GetComponent<RawImage> ();
PauseMenu.enabled = false;
}
void Update (){
if(Input.GetKeyDown("p")) {
PauseMenu.enabled = true;
FirstPersonController.enabled = false;
}
if (Input.GetKeyDown ("Esc")) {
PauseMenu.enabled = false;
FirstPersonController.enabled = true;
}
}
}
I'm currently attempting a pause screen for my game, but it won't work.... why is this? Thanks!
Comment
Best Answer
Answer by Nikunj-Kareliya · Sep 13, 2015 at 10:01 AM
using UnityEngine.Internal;
Add semi colon at the end :-D
Your answer
![](https://koobas.hobune.stream/wayback/20220612033540im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
OnCollisionEnter not working 1 Answer
Alarm lights not changing 1 Answer