Unity: Creating a nicer background

Objective: We want to make it so that the background of our game isn’t just a black screen to build a bit of an environment to our game.

First, we need to switch our game to a 2D view to help make things look better when setting up our game in the scene view. It’ll be at the top left of the scene view window.

Just click the 2D button so it’s highlighted and you should see a change in the view of the scene.

Next, we need to add our background sprite into the hierarchy and adjust the size to match the size of the game. You do this by using the rect tool and pulling the sides and corners to make it bigger or smaller until you have a size you’re happy with.

You can also press the T key when in the scene view.

Once it’s all fit together, we can add our player sprite to the hierarchy so we can see how the game will look. One thing you’ll notice is the player can go behind the background which we don’t want. To fix this you will need to go into the sorting layer under the sprite renderer and we will wan to create a background and foreground layer or change to order of layer to 0 for the background and the player to 1.

--

--

--

I am hard working Game development student learning as much about game development and unity as possible.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Windows 95 turns 25 years old

Funny Command Which Makes Linux Interesting For You…

Create a multi node K3S cluster using an external database

Constraint Layout Quick Guide

Top 4 Open-source Music Software You Can Use Without Restriction

The Flaws in Polyglot Persistence

Java-SpringBoot Application with Keycloak and Kubernetes Deployment

Database integration tests in local environment

Hard disk internals

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Jake Boere

Jake Boere

I am hard working Game development student learning as much about game development and unity as possible.

More from Medium

Enabling Unity Ads

Level Design in Unity Part 1: The Floor

Ease Of Building UI Elements In Unity

Switching Cameras Based on Animation States in Cinemachine