Optimizing the UI

A little bit of a boring topic, but a necessary one! A few things I’ve learned can help get a bit of performance out of your game through optimizing the UI!

— — —

First we are going to go over two types of UI elements, Active canvas items and Static canvas items.

What is important to know is that when things change on the canvas, which is called dirtying the canvas, Unity has to redraw everything within that canvas. That sounds like extra data usage that we can avoid and we can do that by simply dividing active elements, those that change, and static elements, those that do not change, into separate canvas groups. By doing this, we can avoid Unity redrawing static canvas items and thus increase performance.

— — —

The second thing we can look at is Raycast Target on image objects. By default Unity enables this for every image and we definitely do not need this on for anything that does not need to be clicked on. Make sure to turn this off when it isn’t needed!

— — —

The last thing for now is that whenever possible, hide the entire canvas rather than hiding individual GameObjects in the canvas. Unity uses less processing on hiding a canvas rather than a GameObject!

Anyway again, a bit boring but definitely optimization that can easily be done for any project and everything counts!

See you next post!




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

Recommended from Medium

The first hackathon experience!

Training a Corporate Team on Python: An Insight

Development Update: Connext Example Token Tutorial

Naming conventions for android

Comparison of 10 Programming Languages.

Integration testing with MongoDB on Gitlab-CI

Queues: A Tale of Two Stacks

Cover message step nearly.

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
Edward Kim

Edward Kim

More from Medium

Hidden Shortcuts to Make Level Design Easier

2.5D Platformer: Moving Platforms

From Prototype to Art

Daily Progression: Create A Menu Screen Part 2!