<aside> <img src="/icons/reorder_gray.svg" alt="/icons/reorder_gray.svg" width="40px" />
Navigation
</aside>
The game has 2 premade backgrounds, however you can add as many as you want. Let’s modify the existing background first, then we will add a new one.
Find the folder Game/Prefabs/Level Backgrounds
. It contains all existing backgrounds.
Double-click on Blue Background to open it. Background structure is the next:
This structure is not necessary, so you can delete any elements and replace them with whatever you want.
The main thing that can be changed is the Background image. In our case it is a mesh with a texture on top of it. You can change the texture of the material to change how the back looks. To do this:
Select the material.
Change texture that is assigned here.
Alternatively, you can remove Mesh Renderer
and Mesh Filter
components and add a Sprite Renderer
to be able to use a simple sprite.
For this remove Mesh Renderer and Mesh Filter
Add Sprite Renderer
Assign the image and set the Order in Layer to -1
Set rotation to (0,0,0) and adjust position and scale if needed.
Now how to add a new background. Return to the Game/Prefabs/Level Backgrounds
folder. Select any of existing backgrounds and press Ctrl + D (Cmd + D) to duplicate it. Rename duplicated element.
Double-click it and do all necessary modifications following this instruction starting Step #3
Next, we will integrate the new back into the game. Open Level Editor using Tools > Level Editor
. Select the Level Backgrounds tab.
Click the Modify
button to add another element.
Click the +
button
Enter the name. Important: do not use spaces or special symbols. Press Save
.
Return to the Level Backgrounds
tab and assign a prefab value with an object we created in Step #7.
A new background can now be assigned to any level.