Thursday, October 9, 2025

Greatly Increase Performance For Free With An Update Publisher In Unity!

Does your game or application in Unity use a lot of update loops that slow down performance? No need to install plug-ins or special packages, greatly increase performance for free with an update publisher in Unity. It makes you wonder why this isn’t a standard feature anyway (but that goes for a lot of things in Unity).

We’re basically going to make a SINGLE type of update loop for your entire project! As you can imagine, this will lead to a massive performance boost for your game, especially if you use a lot of scripts that implement any kind of update loop.

Understanding the issue: 

What's the problem? Let’s address the issue of update loops in the first place (like Update, FixedUpdate, or LateUpdate) in Unity, because it's more complex than you may think. 

When you put code in an update loop to move a game object, like transform.position += new Vector3(0, 0, 1) * Time.deltaTime;, under the hood a lot of different checks are being performed before the update loop is even validated and started. First, Unity checks if the object hasn’t been destroyed yet, then there's checks if the requirements have been met to be active at all. Even when it passes all these checks, Unity still needs to confirm that its own update method is functioning properly. 

So basically, even BEFORE Unity runs the actual update loop, it’s doing all these involved computations, behavior iterations, call validations, preparing to invoke the method, verifying all the arguments and then finally running the little piece of code you wrote (which hardly is a performance issue compared to the aforementioned. Yes, this even happens with empty update methods accidentally left behind in scripts!

This slows down your project tremendously, and gets worse the more update loops you have!  

When you have lots of objects that implement any update loop in Unity, you can see the problem if it needs to perform these under the hood checks constantly.

Come on!

But what can we do about it? This is yet another case where the Observer Design Pattern comes in!

 

The Solution: 

First, we’re going to make an UpdatePublisher that lives in the scene on its own GameObject. It holds the ONLY Update method in the game, and it’ll notify all the other listeners when it’s called.

The observer itself is an interface, we’ll call it IUpdateObserver:


public interface IUpdateObserver
{
    void ObservedUpdate();
}

Monday, October 6, 2025

10 Most Common Mistakes Beginning Unity Game Developers Make (And How To Avoid Them)

Here are some of the most common mistakes beginning Unity game developers make. You’re eager to start your Unity game development project. You’ve followed a few tutorials and think you’re ready to do it on your own. That’s great, but keep in mind that it’s easy to get lost in all the options Unity has to offer. One of the ‘downsides’ of Unity is that you literally have to do everything on your own, especially when it comes to structuring your project. Keep on reading and make sure you don’t fall for these mistakes, like I have done in the past as a beginner Unity game developer.

 

Monday, September 29, 2025

6 Design Patterns Every Unity Developer Needs to Know

There are many reasons why there are design patterns every Unity developer needs to know. To know, and to fully understand that is. If you are a beginning game developer, you’ve undoubtedly already applied some of these patterns in your own game design project without even knowing it. Which pattern is the best depends on the nature and the game design structure. I use a combination of design patterns in my project; predominantly the observer and the singleton pattern. Below, we're going over all those design patterns, along with their pros and cons. Find out what the most common game design patterns are in Unity 6, with examples, so you can easily copy and paste them in your own project!



Wednesday, September 24, 2025

11 Ways to Optimize Performance in Unity 6 You Probably Didn't Know

 

I know, one of the most challenging and important tasks as a game developer is to optimize performance in Unity 6. The problem is that it’s not always clear what causes the lag or stutter. Perhaps after some deep diving into the issue, you come to find out that a texture was of too high a resolution. Or that there were too many unnecessary vertices on a 3D model. Or maybe your scripts are not optimized.

Even if your game is running flawlessly on your machine when play testing, it may struggle on another for no apparent reason. Below, I’m going to mention some of the most common ways to optimize performance in your game development project in no particular order. Some are easy to implement, others may require a bit more research. Some may not even apply to your current game development project at all, but in any case go over it and make sure your game is as optimized as can be (you may need it for your next project!).



Tuesday, September 23, 2025

Top 10 Ways to Cache References in Unity 6 (and the Best Ones!), with Code Examples!

 

The beauty of the Unity Game Engine (and its downfall for some at the same time) is the amount of freedom it gives you when developing your game. There are multiple ways to structure something that result in the exact same outcome, but one approach is often better than another. Which one is best depends on your game design architecture, but overall it’s safe to say some methods are generally stronger regardless of your structure. Choosing the right way to cache references in Unity can greatly enhance the performance of your game.


Here are 10 ways you can cache references in Unity, along with their pros and cons, in no particular order: