Skip to main content

Posts

Showing posts with the label unity space shooter tutorial

#P6 Kick Start - Unity [Moving the player]

1. Create project folder 2. Name the folder as scripts 3. Create new component, new script, name it as PlayerController, the script name must be started using Capital letter. Drag the script to "scripts" folder. *change the language to c# 4. Lets start scripting! double click the PlayerController script, it ll lead us to MonoDevelop-unity, scripting editor that bundled with unity software. using UnityEngine; using System.Collections; public class PlayerController : MonoBehaviour { void FixedUpdate () { float moveHorizontal = Input.GetAxis("Horizontal"); float moveVertical = Input.GetAxis("Vertical"); //how much we want our object to move on the y-axis? nono //set to o.of float y_axis = 0.0f; //store the vector object in moving variable; Vector3 movement = new Vector3 (moveHorizontal, y_axis, moveVertical); rigidbody.velocity = movement; } } *ensure the method called Fixed...

#P5 Kick Start - Unity [Adding a background]

Create a "quad" object, rename to "background"    2. Set the background properties, transform the Y-axis to rotate 90 deg.            3. As the quad comes together with mesh collider, this time we going to remove it.                                          4. drag image "nebula" from our assets folder<textures to the background object           5. Change the background object setting to fit our game screen. Change a-axis to 15 and y-axis 30 aspect ratio of 1:2                                                                                                 ...