Adding a background
There is still a lot of black in the background and as the game has a space theme, let's add some stars in there. The way we'll do this is to add a sphere that we can map the stars texture to, so click on Game Object | Create Other | Sphere, and position it at X: 0
, Y: 0
, Z: 0
. We also need to set the size to X: 100
, Y: 100
, Z: 100
. Drag the stars
texture, located at Textures/stars
, on to the new sphere that we created in our scene. That was simple, wasn't that? Unity has added the texture to a material that appears on the outside of our sphere while we need it to show on the inside. To fix it, we are going to reverse the triangle order, flip the normal map, and flip the UV map with C# code. Right-click on the Scripts
folder and then click on Create and select C# Script. Once you click on it, a script will appear in the Scripts
folder; it should already have focus and be asking you to type a name for the script, call it SkyDome
. Double-click on the script in Unity and...