Mover' does not contain a definition for 'Cancel' and no accessible extension

This is the whole error :slightly_frowning_face:
Assets\Scripts\Combat\Fighter.cs(24,39): error CS1061: ‘Mover’ does not contain a definition for ‘Cancel’ and no accessible extension method ‘Cancel’ accepting a first argument of type ‘Mover’ could be found (are you missing a using directive or an assembly reference?)

I think the problem I keep on having are because I am doing the course out of order. I Googled and I can see that Mover is deriving from Fighter, which has Cancel, but Mover itself has no Cancel.

Does Cancel need to be in Mover, and if so, does it need to be above the method that calls it in the code?

I strongly recommend against doing the courses out of order. Each lecture in the course builds upon code we’ve implemented in previous lectures. Doing them out of order will likely lead to more confusion and more errors.

At a certain point, both Fighter and Mover will implement the IAction interface. That interface is simply

public interface IAction
{
    void Cancel();
}

Noted. Should I just cut and paste the completed code so I don’t have to keep making these posts?

The best course of action would be to start from the beginning, building the scripts following Sam and Rick. Putting the completed code in when you’re still learning the project will

  • Not really help you learn
  • Very likely break your project

What a stroke of brilliance. Why didn’t I think of that. Guzzle down a bottle of my finest, set the videos to random order… and all this time, I was watching the videos in reverse :wink:

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

Privacy & Terms