Skip to content

The code for a short tutorial on finite state machines and how to use them for basic 2D physics-based player movement in Unity/C# (in text or video format).

License

Notifications You must be signed in to change notification settings

MinaPecheux/UnityTutorials-FiniteStateMachines

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Unity/C#] Finite State Machines

Mina Pêcheux - July 2021

What are FSMs, aka Finite State Machines? How can we use one to implement basic physics-based 2D player movement? Let's discover more in these 2 video/text tutorials:

  • "How to make a basic finite state machine in less than 30 minutes" (read it on Medium or watch it on Youtube)
  • "How to make a hierarchical finite state machine in less than 30 minutes" (read it on Medium or watch it on Youtube)

thumbnail01 thumbnail02

In these tutorials, I'm discussing how we can model entity behaviour via state machines, what are the benefits and the costs of implementing one and how hierarchical state machines can help you share logic without repeating code. The series uses 2D physics-based player movement (with rigidbodies) as a direct application example.

This Github repo contains the code that is written throughout those tutorials:

  • the parent virtual classes that define state machines and their inherent states
  • the actual instantiable classes derived from those for our specific 2D-movement state machine

demo

About

The code for a short tutorial on finite state machines and how to use them for basic 2D physics-based player movement in Unity/C# (in text or video format).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages