hey friends,
I’ve been running into this error ‘‘All compiler errors have to be fixed before you can enter playmode! UnityEditor.SceneView:ShowCompileErrorNotification()’’
I feel like no matter what I type after the ‘void update’ section the error keeps on popping up
please advise!
First of all, the console does state what the error is, you need to scroll to see it, or just hit “Clear”, which will clear all console messages except from errors. If you want to see that error in Visual Studio, hover the mouse over the red squiggly line to see it.
Could you also post your code here? Don’t forget to format it so that it’s easier to read (see image below). The more info you post here, the easier it is for us to help you
Dear Michael,
thanks for your reply
here is the code that i've copied from Unity documentation
{
{ if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Space key was pressed.");
}
}
strangest thing is that everything works before i get into the ‘‘void update’’ section, even when i remove the code same error keeps on showing on and on again!
thank you
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizzard : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
int max = 1000;
int min = 1;
Debug.Log("Welcome to Number Wizzard!");
Debug.Log("Pick a nmber, don't tell me what it is....");
Debug.Log("The highest number you can pick is " + max);
Debug.Log("The lowest number you can pick is " + min);
Debug.Log("Tell me if your number is higher or lower than my guess");
Debug.Log("Push up = higher, Push Down = Lower, Pus Enter = Correct");
}
// Update is called once per frame
void Update()
{
{ if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Space key was pressed.");
}
}
thank you, i did remove the extra curly bracket and clicked save, yet nothing changed.
Here is the script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NumberWizzard : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
int max = 1000;
int min = 1;
Debug.Log("Welcome to Number Wizzard!");
Debug.Log("Pick a nmber, don't tell me what it is....");
Debug.Log("The highest number you can pick is " + max);
Debug.Log("The lowest number you can pick is " + min);
Debug.Log("Tell me if your number is higher or lower than my guess");
Debug.Log("Push up = higher, Push Down = Lower, Pus Enter = Correct");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.UpArrow))
{
Debug.Log("Space key was pressed.");
}
}