Definition missing

Hi Unity is saying that ‘State’ does not contain a definition for ‘GetNextStates’. It worked up until this lesson, but not after this lesson. I even tried to copy the code from the lecture, but without luck.

I uploaded pics of the code and error message

17

You are calling GetNextStates() from State.cs and Unity is saying it’s not there. Either something is wrong with it, the name isn’t spelled correctly, or it’s not there.

You’re going to have to open up State.cs and see for yourself. Is GetNextStates() in State.cs?

Thank you very much, I overlooked the last s in GetNextStates() and only looked in the AdventureGame.cs file, because that is where the error was called from.

1 Like

Hey Frederik, welcome to the community! :slight_smile:

Just as a heads-up, it is often better to copy/paste your code into your posts on the forum and then apply the code formatting characters, before and after it. It really helps with readability, especially on mobile devices but it also allows those that offer to help you to copy/paste parts of your code back, perhaps with suggestions/corrections, without having to type the whole lot out. If it’s quick to answer you’ll often find you get more responses :slight_smile:

Screenshots are, of course, very useful for error messages or details from the Unity editor itself.

Hope this is of use :slight_smile:


See also;

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

Privacy & Terms