UI in Unity: Creating a User (Player) Profile

Zac Bogner
3 min readFeb 12, 2024

In the previous article, we made a PIN verification system.

This article, we will build a Player profile to select from a login of User Name, Password or PIN.

We will make 4 new input fields, each having 2 buttons included.

The user can login by creating a user name and password to login or enter a PIN.

For the User (Player) Profile we will be implanting that fully in this article.

We will be implementing all the functionality within a new script Player Login.

We will insert all the properties needed. To simplify we will create Arrays [] for the 4 input fields and 4 buttons. These are individual elements listed together defined by index of 0, which equal 1. 0 == 1 index in array slot, etc.

Then, we will want to link all of the references.

  • Note: A simple way to assign all references into an array slot is to lock the inspector, then select all needed to assign, and drag into the empty element array.

We will make CreateAccount, PlayerLoginAccount, and CreatePlayerprofile functions to insert out data.

Here we can test the create profile method.

Then we create player profile function, where we check if the text length is greater than a character length assigned.

Next, we create the Login Profile function, where we need to check the array elements if the username and password are correct.

Here we can test our account creation for the player profile to create a username, password, and enter our username and password to login successfully.

Now, we have created a user login, to where we can add gameplay functionality to control our login state to play or progress in the application.

Next, we will explore how to make a simple Math game, and add it as an extra login method.

--

--

Zac Bogner

Game Designer and Level Designer, formerly with Rainbow Studios. Focused in Unreal Engine with experience in Unity. Former Race Car Driver.