Using a State Machine in stead of a Scheduler

The Scheduler seems like a great way to solve this, I was wondering though, I feel like I often see this sort of issue being solved with a State Machine. Would this be more usual? Would it be better? Does any of these 2 approaches scale better? Do they actually solve the same problem or am I understanding the use case wrong?

Anyway thanks in advance and curious to hear your thoughts!

1 Like

Both the ActionScheduler and the StateMachine are different ways of solving the same problem.

I find the ActionScheduler to be a more robust implementation because aside from classes needing to know about Mover, different classes don’t need to actually know about each other… For example, you could have a Collector class that gathers pickups, a PlayerConversant that moves to a dialogue speaker, or a Shopper component that moves to a Shop, and none would need to know about each other to switch states. (this will become clearer when we get to IHandleRaycast later in the course).

For an excellent deep dive in a pure StateMachine, I recommend our Third Person Combat and Traversal course, taught by Nathan. It’s actually quite possible to adapt that StateMachine to the RPG course with some slight modifications.

1 Like

Thank you so much! That gives me some more things to look into :slight_smile:

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

Privacy & Terms