Uploaded January 2020 | Updated September 2026, 3 weeks ago
Sign up for the Level 2 Game Dev Newsletter: eepurl.com/gGb8eP
In this video, I'm going to teach you how to code a simple State Machine in Unity.
#Unity3d #UnityTutorial, #GameDevelopment
Have you ever written a method with two paths of execution? It probably had an if statement based on a member variable, right? But then your requirements changed, and you added another condition to handle a new state. And I bet they change again, over and over, until your code became a mess of hard-to-read flow logic and conditional statements.
If that's you, then you should learn about State Machines. State Machines are an implementation of the State Pattern, a behavioral design pattern that enables an object to control its internal behavior at runtime. In this Unity tutorial, I'll walk you through the implementation of a simple State Machine that handles the logic of a turn-based battle system.
📦 Download the Project: patreon.com/posts/32870529
🎓 Related Courses & Videos
- app.pluralsight.com/library/courses/building-state-machines-dotnet/table-of-contents
- youtube.com/watch?v=E45v2dD3IQU
👨💻 Join our community: discord.gg/NjjQ3BU
❤️ Support the channel: patreon.com/infalliblecode
My Favorite Unity Assets 💯⤵️
1️⃣ Odin Inspector: assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1100l3e8M
2️⃣ Shapes: assetstore.unity.com/packages/tools/particles-effects/shapes-173167?aid=1100l3e8M
3️⃣ Easy Save: assetstore.unity.com/packages/tools/input-management/easy-save-the-complete-save-load-asset-768?aid=1100l3e8M
4️⃣ Dialogue System for Unity: assetstore.unity.com/packages/tools/ai/dialogue-system-for-unity-11672?aid=1100l3e8M
5️⃣ Editor Console Pro: assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889?aid=1100l3e8M
⚡ Learn more about Unity 3D Plus at http://prf.hn/click/camref:1100l3e8M/destination:https://store.unity.com/products/unity-plus
👋 Contact me directly at charles@infalliblecode.com
* Disclosure: These are affiliate links, which means I'll receive a commission if you use them to make a purchase.
Sign up for the Level 2 Game Dev Newsletter: eepurl.com/gGb8eP
In this video, I'm going to teach you how to code a simple State Machine in Unity.
#Unity3d #UnityTutorial, #GameDevelopment
Have you ever written a method with two paths of execution? It probably had an if statement based on a member variable, right? But then your requirements changed, and you added another condition to handle a new state. And I bet they change again, over and over, until your code became a mess of hard-to-read flow logic and conditional statements.
If that's you, then you should learn about State Machines. State Machines are an implementation of the State Pattern, a behavioral design pattern that enables an object to control its internal behavior at runtime. In this Unity tutorial, I'll walk you through the implementation of a simple State Machine that handles the logic of a turn-based battle system.
📦 Download the Project: patreon.com/posts/32870529
🎓 Related Courses & Videos
- app.pluralsight.com/library/courses/building-state-machines-dotnet/table-of-contents
- youtube.com/watch?v=E45v2dD3IQU
👨💻 Join our community: discord.gg/NjjQ3BU
❤️ Support the channel: patreon.com/infalliblecode
My Favorite Unity Assets 💯⤵️
1️⃣ Odin Inspector: assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1100l3e8M
2️⃣ Shapes: assetstore.unity.com/packages/tools/particles-effects/shapes-173167?aid=1100l3e8M
3️⃣ Easy Save: assetstore.unity.com/packages/tools/input-management/easy-save-the-complete-save-load-asset-768?aid=1100l3e8M
4️⃣ Dialogue System for Unity: assetstore.unity.com/packages/tools/ai/dialogue-system-for-unity-11672?aid=1100l3e8M
5️⃣ Editor Console Pro: assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889?aid=1100l3e8M
⚡ Learn more about Unity 3D Plus at http://prf.hn/click/camref:1100l3e8M/destination:https://store.unity.com/products/unity-plus
👋 Contact me directly at charles@infalliblecode.com
* Disclosure: These are affiliate links, which means I'll receive a commission if you use them to make a purchase.






![[GameDev Stream] Advanced Project Setup in Unity (7/12/2020)
Sign up for the Level 2 Game Dev Newsletter: http://eepurl.com/gGb8eP
In this stream, were going to take a look at a more advanced project structure in Unity thatll help you create games that are more flexible and resilient to change.
#Unity3D #GameDevelopment #LiveStream
Jason is a Unity game developer with years of experience. Charles is a software developer whos passionate about making games. In this live stream, well answer questions about Unity, programming, and game development, plus do a live code review.
Timestamps:
00:00 - Stream Start
00:36 - Introductions
02:35 - Disclaimers
04:00 - User Requirements
08:49 - Unity Example
13:56 - Looking at the Code in Unity
19:05 - Console Example
22:33 - Testing
29:25 - Is this too much?
33:30 - Project integration
40:50 - How Dlls Work
55:10 - Working outside unity
1:05:05 - MsBuild - After Build Copy
1:12:20 - Dll Linking
1:24:16 - Conclusion
👨💻 Join our community: https://discord.gg/NjjQ3BU
❤️ Support the channel: https://www.patreon.com/infalliblecode
My Favorite Unity Assets 💯⤵️
1️⃣ Odin Inspector: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1100l3e8M
2️⃣ Shapes: https://assetstore.unity.com/packages/tools/particles-effects/shapes-173167?aid=1100l3e8M
3️⃣ Easy Save: https://assetstore.unity.com/packages/tools/input-management/easy-save-the-complete-save-load-asset-768?aid=1100l3e8M
4️⃣ Dialogue System for Unity: https://assetstore.unity.com/packages/tools/ai/dialogue-system-for-unity-11672?aid=1100l3e8M
5️⃣ Editor Console Pro: https://assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889?aid=1100l3e8M
⚡ Learn more about Unity 3D Plus at http://prf.hn/click/camref:1100l3e8M/destination:https://store.unity.com/products/unity-plus
👋 Contact me directly at charles@infalliblecode.com
* Disclosure: These are affiliate links, which means Ill receive a commission if you use them to make a purchase. [GameDev Stream] Advanced Project Setup in Unity (7/12/2020)](https://i.ytimg.com/vi/ITnUq2AeC40/mqdefault.jpg)



![[GameDev Stream] How to Write Self Documenting Code (11/8/2020)
Sign up for the Level 2 Game Dev Newsletter: http://eepurl.com/gGb8eP
A lot of developers rely on comments to explain their code. In reality, your code should be able to document itself. In this GameDev livestream, Jason Storey and I will share some techniques that we use to write self-documenting code.
#Unity3D #GameDevelopment #LiveStream
Jason is a Unity contractor with years of experience writing games in Unity. Charles is a software developer whos passionate about making games. In this live stream, well answer questions about Unity, programming, and game development, plus do a live code review.
👨💻 Join our community: https://discord.gg/NjjQ3BU
❤️ Support the channel: https://www.patreon.com/infalliblecode
My Favorite Unity Assets 💯⤵️
1️⃣ Odin Inspector: https://assetstore.unity.com/packages/tools/utilities/odin-inspector-and-serializer-89041?aid=1100l3e8M
2️⃣ Shapes: https://assetstore.unity.com/packages/tools/particles-effects/shapes-173167?aid=1100l3e8M
3️⃣ Easy Save: https://assetstore.unity.com/packages/tools/input-management/easy-save-the-complete-save-load-asset-768?aid=1100l3e8M
4️⃣ Dialogue System for Unity: https://assetstore.unity.com/packages/tools/ai/dialogue-system-for-unity-11672?aid=1100l3e8M
5️⃣ Editor Console Pro: https://assetstore.unity.com/packages/tools/utilities/editor-console-pro-11889?aid=1100l3e8M
⚡ Learn more about Unity 3D Plus at http://prf.hn/click/camref:1100l3e8M/destination:https://store.unity.com/products/unity-plus
👋 Contact me directly at charles@infalliblecode.com
* Disclosure: These are affiliate links, which means Ill receive a commission if you use them to make a purchase. [GameDev Stream] How to Write Self Documenting Code (11/8/2020)](https://i.ytimg.com/vi/JJyp8OVwW-s/mqdefault.jpg)