Featured Articles:

Showing posts with label Unity. Show all posts
Showing posts with label Unity. Show all posts

Friday, September 18, 2026

Loops in Coding Explained: for, while, foreach, and do-while in C#

Today is a beautiful day to talk about one of the most useful tools in your programming toolbox: loops in coding. I'm not talking about the Update of Fixed update loops, or Coroutines, for that matter. And why today specifically? Well, I don't know - had to do an intro - and it sounded pretty good.

We're going over the 4 major types of loops you need to know. If you've ever found yourself copy-pasting the same line of code five, ten, or twenty times just to do the same thing over and over, you're about to feel a little silly, because that's exactly what loops are built to solve. 

Let's dive in!

Wednesday, September 16, 2026

Variables In Coding Explained: int, float, double, And Every Type In Between


Welcome to another blog post about the absolute bread and butter of programming: variables in coding. If you're just starting out, you've probably already typed something like int score = 0; without really knowing why it works, or why it had to be int and not something else. Alright, that's fair; hardly anybody explains it well the first time around. 

Maybe I can shine some light on this topic.


Wednesday, September 9, 2026

Understanding the Unity Game Loop: Awake, Start, Update, and Everything Else Explained

Welcome to another blog post about the stuff that quietly runs your entire game, whether you think about it or not. This Wednesday's topic: understanding the game loop in Unity; Awake, Start, Update, FixedUpdate, LateUpdate, OnEnable, OnDisable, Reset, teardown methods, coroutines, and a peek at the rendering callbacks.

If you've ever wondered why your player controller moves like it's had too much coffee on some frames and none on others, or why a script that "should" be running just... isn't, chances are you've got a game loop misunderstanding on your hands. 

This stuff isn't glamorous, but it's foundational. Get it wrong, and every system you build on top of it inherits the wobble.


Let's have a closer look at how it all works together.

Monday, September 7, 2026

Delegates, Events, Actions and Func in Unity: When to Use Each One

Welcome to another blog post about one of those C# topics that trips up almost every solo game developer at some point: delegates, events, Action, and Func. If you've ever stared at a tutorial and thought "okay but why would I use this over just calling a method directly," well, ..you're in the right place. 

Let's take a look shall we? 

 

 

 

 

Friday, September 4, 2026

Getting Started With Unity: 3 Things Beginners Should Learn Before Even Installing The Program

Welcome to another blog post about Unity for absolute beginners. If you've searched around for "how to start Unity," you already know the drill: install the engine, drag a cube into the scene, slap a Rigidbody on it, write ten lines of code to make it jump. Video over, you made the thing move, it feels really productive right? 

That's actually how I started learning Unity as well. But I was struggling really bad. I could not wrap my head around what and why things were happening. Now, that I have been using Unity to design my games for over 6 years, I understand what my biggest issue was trying to learn the engine. That's why my teaching method is a different from all the others out there.

Here's the problem, and I understand why most people would quit after taking a course or two. Not because Unity is too hard, but because nobody explained what's actually happening under the hood before throwing them at the code editor. You can't debug what you don't understand, and you definitely can't build anything beyond a tutorial's exact steps if you don't know why those steps exist in that order.

So my approach is unusual. At this stage you don't have to learn how to make the player jump. Instead I'm going to cover the three things I wish someone had explained to me before I touched a single script: the game loop, how references work, and why starting stupidly small is the actual skill that separates people who finish games from people who don't. 

Let's dive in!

Wednesday, September 2, 2026

State Machines in Unity: 3 Options to Stop Your Game Logic From Turning Into Spaghetti

Welcome to another blog post about writing Unity code that doesn't make you want to throw your laptop out the window. Today's topic: state machines in Unity!

If you've ever written a PlayerController with six bools (isJumping, isRunning, isAttacking, isDead, isReallyDead, isDefinitelyDeadThisTime) and a 100-line Update() full of nested if statements, this one's for you. 

Let's have a look! 

 

Monday, August 31, 2026

Interfaces vs Abstract Classes in Unity: Which One Is Better?

Here we go again, yet another blog post about a debate that's been quietly ruining developer's sleep since the dawn of object-oriented programming. Sit back and relax, because we're finally settling the "interface or abstract class" argument. 

Why This Comparison Even Matters

As a solo game developer like myself, you don't have a senior architect looking over your shoulder telling you your class hierarchy is a big mess. When it comes to interfaces vs abstract classes in Unity, the choice you make on day one tends to snowball... and it'll either be a clean, swappable system, or turn into a tangled inheritance chain you'll be untangling weeks from now. Fully understanding both of them is important, especially at the beginners stage, since this is not even an intermediate topic.

Both let you enforce structure across your scripts. Neither is "wrong." But picking the wrong one for the wrong job is how you end up with an Enemy abstract class that fifteen unrelated objects are awkwardly pretending to inherit from just to get one shared method.

Friday, August 28, 2026

Task vs UniTask vs Awaitable: Performance and API Comparison for Unity Devs

Welcome to another blog post about async programming in Unity, which async should you use? Let's elaborate. If you've ever Googled this while your coroutine spaghetti stared back at you accusingly, you're in the right place. Let's get you something to ponder on over the weekend!

The thing is, Async/await in Unity used to mean one thing: System.Threading.Tasks.Task. Then UniTask showed up and made everyone's coroutines look ancient. Unity's shipped its own native Awaitable type, and suddenly you've got three ways to do the same thing, each with its own opinions about your garbage collector.

So which one should you actually reach for? Let's break down the Task vs UniTask vs Awaitable performance story, the API differences, and where each one earns its spot in a solo game developers toolkit.

 

Friday, August 21, 2026

Inheritance vs Composition in Unity: Which One Should You Use?

How many time have you argued with yourself: should this Enemy class inherit from a base Character class, or should it just be a GameObject wearing a trench coat made of components? Welcome to the inheritance vs composition in Unity debate, a fight that predates Unity by decades, but hits differently when you're the only person who has to live with the consequences of your own architecture.

This isn't an academic computer science debate for you. You're a solo dev. There's no team lead to quietly blame when your class hierarchy buckles under its own weight six months from now. So let's skip the theory-heavy stuff and talk about what actually matters when you're picking a side (or perhaps, you choose a combination of both in your project).

Let do it!

Wednesday, August 19, 2026

5 More Unity Coding Techniques Beginner Developers Probably Don't Know (Part 2)

Back for round two? Good. I hope you've read the previous article. 

If Part 1 covered TryGetComponent & friends, this batch is about the stuff that happens around your components like tags, cameras, and the Inspector itself quietly judging your field values.

Same thing as before: five more practical Unity coding techniques for beginners, real code and no fillers.

 Let's begin!

 

 

Monday, August 17, 2026

5 Coding Techniques Beginner Unity Developers Probably Don't Know

So you've got Start() and Update() down cold. You can drag a reference into the Inspector in your sleep. But somewhere between "my game runs" and "my game runs well," there's a pile of small C# tricks that never quite make it into the beginner tutorials because, let's be honest, most tutorials are just trying to get a cube to move.

This is the good stuff you'll eventually come across, just like I did. Five underrated Unity coding techniques for beginners, with real code, zero fluff!

 

Why These Unity Coding Techniques for Beginners Actually Matter

If you're a solo dev, you're the programmer, designer, and marketing team all at once. That means every shortcut that saves you five minutes today saves you an hour six months from now when you've forgotten why you wrote something the way you did.

These are NOT advanced architecture patterns. You won't need a computer science degree or a whiteboard full of arrows. They're small, practical Unity coding techniques for beginners that quietly make your code safer, faster to write, and less likely to break the moment you rename something.

Let's dive in!

Monday, August 10, 2026

SOLID Principles In Unity Explained Without Needing A Computer Science Degree

FIVE letters, TEN intimidating words, and a bunch of academic jargon that make your eyes glaze over before you even get to the point. Somewhere along the way, "SOLID principles" got a reputation for being something only enterprise developers care about in between coffee breaks and standup meetings.

Here's the thing though: you've probably already broken (or followed) most of these principles in your Unity projects without knowing they had names. SOLID isn't some separate discipline you need to learn, it's just a handful of common-sense guidelines for not making your future self miserable.

 

Let's go through all five, Unity-style!

 

Friday, August 7, 2026

Unity Events vs UnityEvent vs C# Events: Which One Should You Actually Use?

If you've ever Googled "how do I make a button call a function in Unity" and ended up more confused than when you started (which happens a lot in my case - yes I'm looking at you CodeMonkey!), you're not the only one.

"Unity Events," "C# events," and "UnityEvent" all sound like the same thing said three different ways. 

Well, they're not. Surprise! 

 

They're three genuinely different tools, each with their own tradeoffs, and picking the wrong one for the job is how you end up with either a spaghetti mess of references or a UnityEvent doing something a plain C# delegate would've handled in one line.

Let's sort out what's actually what.

 

First, Let's Kill the Naming Confusion

Here's the actual breakdown:

C# events        → the native "event" keyword, built into the language
C# delegates     → Action, Func, and custom delegate types
UnityEvent        → UnityEngine.Events.UnityEvent, the Inspector-serializable one
"Unity Events"    → the loose, informal term people use for any of the above

That last one is the troublemaker! When someone says "just use a Unity Event," they might mean the actual UnityEvent class, or they might just mean "wire up an event, using the inspector." 

Context matters people! 

For the rest of this article, I'll be specific and call out which one I mean, so you don't end up in the same boat. Let's just make it clear, once and for all!!

Wednesday, August 5, 2026

10 ScriptableObject Patterns Every Unity Developer Should Know (Part 3) Factory Pattern, AI Behaviors & Global Configuration

Over the last two articles, we've explored seven practical ways to use ScriptableObjects beyond simple data storage.

We've covered everything from Data Assets and Runtime Sets to Item Databases and Spawn Tables. Hopefully by now it's becoming clear that ScriptableObjects aren't just a convenient place to store numbers, colors or sprites, they're powerful architectural tools that can help keep your project organized as it grows.

In this final part, we'll look at three more advanced patterns that are particularly useful in larger projects.

Don't worry if some of these seem a little intimidating at first, you probably won't need all of them on your next game. In fact, you may never need them at all, but knowing about it is a great addition to your programmer's toolbox.

Remember, good architecture isn't about using every design pattern you know. It's about choosing the simplest solution that solves the problem in front of you.

Let's jump in.

 

Tuesday, August 4, 2026

10 ScriptableObject Patterns Every Unity Developer Should Know (Part 2) Variable Assets, Ability Definitions, Item Databases

In the previous article, we explored three of my favorite ScriptableObject patterns:

            • Data Assets

            • Runtime Sets

            • Event Channels

If those patterns help organize your project, the next four we're covering today help organize your gameplay. They're all about making your game easier to balance, extend, and maintain without constantly diving into your code.

As with every design pattern, these aren't solutions looking for problems. They're practical techniques that shine in the right situations, and as always, can become overkill if used everywhere.

Let's jump in!

Monday, August 3, 2026

10 ScriptableObject Patterns Every Unity Developer Should Know (Part 1) Data Assets, Runtime Sets, Event Channels

If you've read my previous article on ScriptableObjects, you'll know they're far more than glorified data containers. Of course they're fantastic for storing weapon stats, enemy configurations, and game settings, but that's only the beginning.

One of the biggest "wait a minute sister" moments in my personal Unity journey was realizing that ScriptableObjects can also help shape the architecture of an entire project. They aren't just assets sitting quietly in your Project window; they can become communication hubs, registries, and reusable building blocks that make your code cleaner and easier to maintain.

In this mini-series, we're going to explore ten practical ScriptableObject patterns that I sometimes use in my own Unity projects. These aren't theoretical examples you'll only find in programming textbooks. They're patterns that solve real-world problems you'll encounter as your projects grows.

Learning all these patterns is important in my opinion. Even if you don't plan to use them now, you at least know which options are available - and perhaps you may find one useful in the future. All extra useful knowledge you can add to your programmer's toolbox.

In this first part, I'll cover:

  • Data Assets

  • Runtime Sets

  • Event Channels

     

Let's dive in.

 

Sunday, August 2, 2026

Unity 7 Is Coming! Here's Everything You Need to Know

If you've been using Unity for a while, you've probably developed not only your game, but also a healthy amount of skepticism whenever a new major version is announced. We've all seen the flashy presentations, heard promises about revolutionary features, and then gone right back to waiting for shaders to compile while questioning our life choices.

Thankfully, Unity 7, scheduled to be released early 2027, does feel a little different.

Instead of trying to reinvent the engine again, Unity seems to be focusing on something developers have been asking for years: making the engine faster, smoother, and more enjoyable to use every day.

And honestly? That's exactly what I want!

Will they live up to that promise? Who knows, it's a step in the right direction at least.  

I don't need another dozen experimental systems that may or may not exist two years from now. I need my projects to open faster, Play Mode to start quicker, and the editor to spend less time making me stare at loading bars.

Let's take a look at everything Unity 7 is bringing to the table.

Friday, July 31, 2026

ScriptableObjects In Unity And The Hidden Superpowers Most Overlook


When you first encounter ScriptableObjects, it's usually introduced as a way to store data outside of a scene. You create an asset, fill in some values in the Inspector, and suddenly you've got a cleaner alternative to hardcoded variables.

But that's only scratching the surface. It can do more than just hold data!

ScriptableObjects is one of Unity's most powerful and often misunderstood feature. If used correctly, it can simplify your architecture, reduce dependencies, improve reusability, and make your project significantly easier to maintain as it grows.

Unfortunately, it also has a reputation for being overengineered. Spend enough time on Unity forums, and you'll eventually find someone suggesting ScriptableObjects as the solution to virtually every problem. Need an inventory? ScriptableObjects. Dialogue? ScriptableObjects. AI? ScriptableObjects. Coffee machine broken? ...okay, perhaps not that one.

Like any tool, it's at its best when solving the right problem.

Let's deep-dive into what ScriptableObjects really are, when/how/why you should use them, and when it's definitely not the answer.

Thursday, July 30, 2026

Don't Ditch Coroutines for Async/Await in Unity Until You Read This

If you've only ever worked with coroutines, switching to async/await can feel almost magical. The code is cleaner, easier to read, and behaves much like synchronous code.

However, there's an important difference: Tasks are a .NET feature. Coroutines are a Unity feature.

That distinction affects how they interact with Unity's object lifecycle, scene management, and exception handling.

These differences are responsible for many of the mysterious NullReferenceExceptions and "WTF it worked yesterday!!" bugs that developers encounter when first adopting async.


Tasks don't adhere to Unity object lifetimes

This is arguably the biggest gotcha.

Imagine you write a simple async method to open a door:


public async Task OpenDoor()
{
    await Task.Delay(3000);

    animator.SetTrigger("Open");
}
  

Everything works perfectly until the player changes scenes, or destroys the object...or exits play mode. Three seconds later, the task resumes anyway. Now animator no longer exists.

NullReferenceException

You may wonder:

"The GameObject was destroyed. Why is this code still running?"

Because Tasks have no clue what a GameObject is. They're managed entirely by the .NET runtime.


Wednesday, July 29, 2026

Coroutines vs Async/Await vs Awaitable in Unity: Making Sense To Modern Asynchronous Programming

Coroutines have been pretty much the backbone of asynchronous programming in Unity for a long time. When you need to spawn enemies, fade a UI, load a level, or create cinematic sequences, chances are you wrote countless methods returning IEnumerator.

However, Unity has other options regarding this that may be better for your project.

Modern versions of Unity embrace C#'s async/await programming model and, more recently, introduced Awaitable, a Unity-specific asynchronous API that integrates directly with the engine. These additions don't replace coroutines outright but they complement them and, in many situations, offer cleaner, safer, and more powerful alternative.

Perhaps the challenge for many Unity game developers isn't learning the syntax, it's knowing which tool is better for the task at hand.

Let's take a deep-dive into Coroutines, async/await, and Awaitable, including threading, Task.Run(), CancellationToken, AwaitableCompletionSource, performance considerations, and strategies for migrating existing coroutine-based projects.