error CS1525: Unexpected symbol `void'
Hey guys. I literally just started unity and have already run into an error. I'm trying to make it so you can skip a cut scene (by going to the next scene) by pressing space. Here is my code:
using UnityEngine;
public class ExampleClass : MonoBehaviour
void Update()
{
if (Input.GetKeyDown(32))
{
SceneManager.LoadScene("Patricks journey", LoadSceneMode.Additive);
}
}
}
Comment
Best Answer
Answer by mefsh · Jul 17, 2017 at 01:49 AM
You don't have a { under your class.
public class ExampleClass : MonoBehaviour
{
void Update()
{
if (Input.GetKeyDown(32))
{
SceneManager.LoadScene("Patricks journey", LoadSceneMode.Additive);
}
}
}
I can't seem to get it to display as code :(. (Fixed)
You can see it's toolbar on the text editor. Something like 101010 ^^
to get it to display as code press ctrl+k while your code is highlighted, and thank you!