Starting to Make a Game - Making a Splash Screen in Unity3D

So you’re probably wondering, “how hard can it be to build the perfect splash screen?” And you’re probably right to think that — we’re talking about a screen which is going to be visible for just a couple of seconds (if that). And a screen that seems to just flash a logo at the user before vanishing.

Starting to Make a Game - Making a Splash Screen in Unity3D

Splash screens (also known as launch screens) provide a simple initial experience while your game and mobile app loads. They set the stage for your application, while allowing time for the game/app engine to load and your app to initialize. This guide teaches you how to use splash screens appropriately on iOS and Android.

What is a Splash Screen?

Maybe your app needs to load some basic data so that the first screen has some content for the user to see. Maybe your user needs to be authenticated again because they haven’t used the app in a while. Maybe some key images need to be loaded from the server before that first screen appears.

Ask any app developer and they’ll give you a list of 100 things they want to do in the code while the splash screen is loading. But the trick here is to focus that short period of time on the absolute minimum you need so that the next screen to appear has enough content to offer a seamless transition.

Scene Setup

Connecting two scenes together in Unity is fairly straightforward. The basic setup is simple, and then you can embellish your loading screen with additional animations or funny messages however you’d like. At a high level, one scene simply needs to load the other. When the loading of the new scene begins, UI text or a loading bar can be presented within the current scene to let the player know that the computer is working. It’s a good idea to add a small amount of animation to the loading UI so that the player knows the computer is still working.

Splash Screen Tutorial

In this Instructable you will learn how to make a simple splash screen in Unity3D. First, we will open up Unity!

Create a New Project in Unity3D

Go to Project and Right Click on Assets and Create New Folder and Renamed the folder “Scripts”

Go to Build Setting and Switch Platform to Android

Then I added an image by right clicking on the Hierarchy -> UI -> Image and renamed the image "Background".

Your screen should look something like this, don't worry if the layout is different.

Go to Game Scene Window and Select Portrait or Landscape mode currently I am using Landscape mode

Resize Background Image for fit in all mobile devices

Then I will save the scene in the "scenes" folder named "SplashScreen" by typing ctrl + S

Create New Folder, Renamed it Texture and Drag Image in Folder

Then click on your logo and at the top, change the Texture Type to "Sprite (2D and UI)".

After that click on "Apply".

Then add a C# script in the "scripts" folder named "SplashScreen" by right clicking -> Create -> C# script.

Right clicking on the Hierarchy -> UI -> Image and renamed the image "Logo", give size Width : 400 and Height : 400

Drag Logo Image in Hierarchy.

Added an image by right clicking on the Hierarchy -> UI -> Image and renamed the image "Fade". And Change the Color according to your choice.

Now Click on Add Component and attach Canvas Group to Image and Set Alpha to 0

Then I added an Empty GameObject by right clicking on the Hierarchy -> Create Empty GameObject and renamed the GameObject "Code".

Add Script to Empty GameObject by dragging it.

Add Code to Script(SplashScreen.cs)

If you double click on the C# script, MonoDevelop or Visual Studio will open

Then delete all the default code and copy+paste this into the script:

If you have any questions about how the code works comment what you want to know I will gladly help!

If you did everything correctly then when you click on the play button at the top you will see a splash screen!

If you had any problems or if you have any questions or comments, comment them below!

Hopefully you found this interesting. Thanks!

Files

What's Your Reaction?

like
1
dislike
0
love
0
funny
0
angry
0
sad
0
wow
1