Setup your UI for navigation and use with keyboard and controller in Unity

Published: 10 February 2025
on channel: Christina Creates Games
1,165
89

In this tutorial, you will learn how to set up a UI Navigation by keyboard and gamepad in Unity. You'll see how to configure the Event System, adjust automatic versus explicit navigation and add simple code in case you want to constrain the user to certain menu parts or pick the next element to select when the player presses a button. Whether you're organizing a basic main menu or a more complex system, this step-by-step guide shows you how to create a user interface that behaves exactly as intended.

This tutorial is all about creating a functional UI your users can navigate by keyboard or controller. It covers:
The built-in Unity navigation system
Setting up an initial gameobject to highlight
Working with selectables
How to make a menu circle around
Working with explicit navigation vs automatic navigation
Pitfalls of automatic navigation
How to set an element to select by code
How to constrain a user to one menu/part of the UI
How to prevent de-selecting elements

Hope you'll enjoy it!

💬 Discord 💛
You are very welcome to join!   / discord  

📖 Github
Find my scripts here: https://github.com/Maraakis/Christina...

💸In case you'd like to support what I do
https://ko-fi.com/christinacreatesgames

🛍️ Affiliate links 🛍️
If you'd like to support my channel, please use my affiliate links when buying cool stuff:
My favourite assets I install by default into every project: https://assetstore.unity.com/lists/hi... [affiliate]
Synty Store: https://syntystore.com/mh/christina

🌟 Need help with your project's UI?🧠
I have been a designer for more than 15 years, a teacher for three and I offer paid consulting for your project! You can find all the information here:
https://www.vennegerts.com/gamedevelo...
I am looking forward to hearing from you 💛

🎮 Play my games on Itch.io 🎮
https://christinacreatesgames.itch.io


📖 Chapters
00:00 The result of this UI Navigation Tutorial
00:23 Scene Setup
01:18 How to enable keyboard and controller input on UI
02:33 How to make a menu circle around (Explicit Navigation)
05:40 Fixing the order elements get selected in (Automatic Navigation)
08:27 How to set a selected element by code
11:14 How to disable deselecting elements
12:17 The result and where to go next


Watch video Setup your UI for navigation and use with keyboard and controller in Unity online, duration hours minute second in high quality that is uploaded to the channel Christina Creates Games 10 February 2025. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,165 times and liked it 89 visitors.