Build a Better Finite State Machine in Unity @git-amend
Build a Better Finite State Machine in Unity  @git-amend
Uploaded July 2023 | Updated September 2026, 19 hours ago
In this video, we're going to build a flexible and efficient object-oriented state machine in Unity using C#. The days of using an enum state machine are OVER! This tutorial covers everything from defining states, implementing transitions and predicates and moving between animations using code, all with SOLID principles and the State and Strategy programming patterns. Master these concepts, and you'll be well-equipped to design advanced, reusable state machines for your game projects.

πŸ”” Subscribe for more Unity Tutorials youtube.com/@git-amend

#unity3d #gamedev #indiedev #statemachine #3dplatformer

β–¬ Contents of this video β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬β–¬

0:00 Intro
1:00 Overview
2:13 States
3:55 Predicates
5:00 Transitions
5:44 State Machine
10:00 Refactoring
14:40 Demo
15:30 Challenge
20:17 Challenge Demo

*Source code:* github.com/adammyhre/3D-Platformer.git

*Open Source Used In This Video*
github.com/KyleBanks/scene-ref-attribute.git

*Assets Used In This Project* (Affiliate Links)
Dungeon Mason Tiny Hero Duo: (FREE): assetstore.unity.com/packages/3d/characters/humanoids/rpg-tiny-hero-duo-pbr-polyart-225148?aid=1101lw3sv
MeshTint Burrow (FREE): assetstore.unity.com/packages/3d/characters/creatures/meshtint-free-burrow-cute-series-184837?aid=1101lw3sv
Cartoon Remaster VFX (FREE): assetstore.unity.com/packages/vfx/particles/cartoon-fx-remaster-free-109565?aid=1101lw3sv
Casual Game SFX (FREE): assetstore.unity.com/packages/audio/sound-fx/free-casual-game-sfx-pack-54116?aid=1101lw3sv
Ultimate Low Poly Pack: assetstore.unity.com/packages/3d/props/low-poly-ultimate-pack-54733?aid=1101lw3sv
DOTween (FREE): assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676
DOTween (Pro): assetstore.unity.com/packages/tools/visual-scripting/dotween-pro-32416?aid=1101lw3sv

*Follow me!*
https://linktr.ee/gitamend
Build a Better Finite State Machine in UnityHierarchy Hack: Add Indicator Icons for EASY DebuggingUniTask: How It Replaces Coroutines, Tasks and AwaitableCode Like a Pro: Refactoring to Patterns!Unity Assembly Definitions Explained (Architecture, Not Just Compile Times)Fix Your Unity Projects FAST with this FREE ToolHigh-Performance Animations With LitMotionBuild Your Own Dependency Injection in less than 15 Minutes |  Unity C#How To Fix Game Controls And UI Fighting Each Other In Unity!5 Unity Certification Questions That Catch Developers Off GuardSpawn and Pool Decals in Unity for Realistic ImpactsVisitor: How I Mastered the Toughest Programming Pattern
git-amend |

Build a Better Finite State Machine in Unity

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER