Organizing your UI for performance in Unity

My currently unoptimized galaxy shooter UI.

In a nutshell, Unity recommends you separate your canvases based on whether you will update them or not. The canvas that you don’t update will have purely static elements and be called the static canvas. The canvas you do update will be the active one. The reason it’s done this way is when you modify an element inside a canvas, it’s considered ‘dirtying up the canvas’ and so every element inside of the canvas must be redrawn.

Unity also raycasts every image on the canvas. It’s important that if an image isn’t clickable, you turn off raycast target.

Don’t turn off the canvas object, instead turn off the canvas component. It’s more efficient.

Hope this helps! You can always check Unitys official optimization tips page for more updated information!

cartoonist, game artist, and wanabe gamedev.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

#4. The World of Arrays

IoT Robotics Microcontroller

Boost your team’s performance with ScriptRunner for Confluence Cloud

Building a Kotlin Mobile App With the Salesforce SDK: Synchronizing Data

Under the hood C++ STL

Postgres — Query Performance Tuning

The evolution of the engineer

My Dev Journey so far …

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Esteban Ibarra

Esteban Ibarra

cartoonist, game artist, and wanabe gamedev.

More from Medium

Using Signal Emitters in Timeline to Access C# Scripts

Eyesight in Unity

Unity Feature 101: Resources Class

2D Mobile Game: Attack Animation