I am just trying to follow along and I can’t overcome the error CS0122 inside the PlayerStateMachine.sc.
I have rewatched the videos and looked at the code and just need a helping hand.
SwitchState in the PlayerStateMachine seems to not be able to switch state because the script doesn’t inherit from PlayerBaseState…? But it’s the same as what Nathan instructed?
Your SwitchState in the base class is private (no access modifier = private). You should make it public or at the very least protected. (Nathan’s is public)
This should be
public void SwitchState(State newState)
// or
protected void SwitchState(State newState)
Other classes can’t access private members. protected members are ‘private’, too, but can be accessed by inheriting classes