fasadoutdoor.blogg.se

Space shooter unity assets
Space shooter unity assets














The mat variable will be used to get the material component from our quad object. So first, let’s create a script called BackgroundScroll.

#Space shooter unity assets update#

The idea here is to update the offset every frame, causing the background to scroll to the left. To add a scrolling effect to the background, we have to make use of the material’s X offset. So now that we have our background ready to go, we just need to make a script to make it scroll infinitely. So instead, let’s go to Unlit -> Texture, and now it should look like this: Unlit Background This takes lighting into account, and since we haven’t implemented lighting in our scene, we don’t need to use it. The reason for that is because in the quad’s Inspector, where our material is, the shader is set to standard: Standard Shader So now our background is in the scene, but it’s looking a bit dark. After that, we can grab one of the images and drag it into our quad in the Hierarchy. We want this to be set to Repeat so we can have a scrolling background. The next thing to check is the Wrap Mode. Since we aren’t using our texture as a sprite, we can change this to Default. First, the Texture Type is set to Sprite (2D and UI). Before we attach our background to the quad, we need to change a couple of things in the Inspector. Next, in our project, let’s right-click in the Hierarchy and go to 3D Object -> Quad.Ī quad is a flat square made with two triangles that we can use to attach a texture, namely our space background. For that, we can use this space background from the Unity Asset store. The first step is to grab a background for our game. We will be adding a space background to our game, and give a scrolling effect to make it feel like we are actively flying through space. So in this post, we will doing just that. Since this project is a space shooter, it would make sense if the ships were actually flying in space.














Space shooter unity assets