How to Unity
Unity UI — First Selected
Make navigation available without clicks or taps
In this article, I showed how to set up button navigation via arrow keys or gamepad. In the end, I pointed out how buttons need to be selected in order to be navigated.
Selection is usually carried out by mouse click or tap (with touchscreens) on the button.
But what if non of that is possible? What if the game is being developed with only a keyboard or gamepad input in mind? Buttons will never be selected, thus never be navigated!!
There’s a solution, though.
In Unity’s EventSystem, the “First Selected” feature allows you to specify which UI element should be initially selected when appearing on the canvas.

When you created a canvas, an “EventSystem” game object was created along. In its inspector view, there is a cool option named “First Selected”, which can be populated by dropping the button you want to have selected by default.
This feature is handy for accessibility purposes, as it allows users who may not be able to use a mouse or touch screen to navigate your UI with ease. It also provides a clear indication to all users of the UI's focus, improving overall usability and user experience. Let’s see an example, let’s link the third button to be the First Selected, then start the game:


If you liked the article, please clap to it and share it! Also, take a look at my games!

Get access to my stories and those of other Medium writers for just $5 a month. With no additional cost to you, I will receive half of your payments as a commission: it’s a great way to support me!
Join my newsletter and receive regular notifications when I post.





