The name 'KeyCode' does not exist in the current context

Blockquote
private void ManageState()
{
var nextStates = state.GetNextStates();
if (Input.GetKeyDown(Keycode.Alpha1))
{
state = nextStates[0];
}
else if (Input.GetKeyDown(Keycode.Alpha2))
{
state = nextStates[1];
}
else if (Input.GetKeyDown(Keycode.Alpha3))
{
state = nextStates[2];
}
textComponent.text = state.GetStatesStory();
}

I have entered the code exactly how the video instructs but when I click play this error message comes up at the bottom of unity. Whereas the demonstration in the video works perfectly fine.

How can I fix this as I’m doing exactly the same thing as the demonstration but not getting the same result.

Capitation and check you includes at the top.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms