Boundless blue skies, smoldering apocalyptic horizons, the vast reaches of space, or a iridescent night sky. All these are possible with the help of Skyboxes. At it’s core a skybox is just a sphere of textures that wrap around the game world or in Unity’s case a basic 6 sided set of textures. There are a few different styles of skybox but this is it’s most basic form.
So how do you make your own skybox? Well that’s easy just follow along, first we’ll start by downloading a proper set of skybox textures. Luckily the Unity Asset Store makes that easy and there’s an excellent (and free) resources called Space Skyboxes (here) by StumpyStrust, just download it and import it into your project.
Next we’ll click on the material and then the Shader drop down in the inspector. Select Skybox > 6 Sided this will then show the 6 texture boxes that stitch together to create the skybox. Space Skyboxes provides 6 sided textures of the skyboxes to help us along. Just added the correct textures to each box as labelled to the corresponding slots. Next the real magic happens, applying our skybox to the scene.
Your skybox should look similar based on what you picked. You can also preview the skybox in the preview window below to make sure it looks correct. Pay special attention to the naming conventions as getting turned around can make it look strange. It is worth mentioning that right and left appear to be reversed in this pack as a mistake of the creator. Just set left to right and right to left.
Click the lighting tab in the inspector and then click on Skybox Material then select your skybox material to set the scene’s skybox to yours. If for whatever reason the skybox doesn’t appear make sure that your Main Camera sets its Clear Flags to Skybox. This should be your end result, which should be a seamless skybox to act as your backdrop game’s terrain and environmental features.
You can learn about all the different types of skyboxes (here) that make Unity’s robust skybox system. A 6 sided skybox is a simple iteration but can do so much to improve the immersiveness of your games. Until next time, happy coding.