Creating a Sliding mobile menu in Unity
Often you hay have seen sliding of UI panels when navigating across an app. Like clicking on the settings icon slides out the home screen and slides in the settings menu.

In this article, we will be creating a simple yet scalable sliding menu system that I am personally using in most of my Android games.

I will be using DoTween for making animations. So you need to install DoTween package in your Unity Project

Creating the Home and Settings Menu

To begin with, I have created a scene with two UI elements (Home and Settings menu) covering the complete screens as shown in the gif below.

The Home and Settings are two images covering the full screen containing elements like settings button, back button, and Labels.

Creating HomeUIManager and SettingsUIManager

Now we need to create UI Managers for each of the menu screens. In this case, we will have two Managers, each for Home UI and for Settings UI.

Create a script HomeUIManager.cs and paste the following code into the file.

Create a script SettingsUIManager.cs and paste the following code into the file.

After creating these scripts, attach the HomeUIManager.cs script to the HomeUI panel covering the full screen.

Attaching HomeUIManager.cs to Home UI

Also, attach the SettingsUIManager.cs to the Settings UI element.

Attaching SettingsUIManager.cs to Settings UI

Now click on the Play button and notice how the Home and Settings menu gets position itself side by side with the Home menu completely visible and the Settings menu hiding beyond the screen.
['Kunal Tandon']
['Programming', 'Game Development', 'Games', 'Unity', 'Technology']