Skip to main content

Posts

Showing posts with the label unity 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...

#P4 Kick Start - Unity [Setup Camera and Lighting]

To follow this tutorial, its a pre-requisite for us to follow previous tutorials as well http://ubuntuanakramli.blogspot.com/2014/10/p4-kick-start-unity-player-settings.html In this tutorial we ll setup the camera and lighting for our game. -this game is top down style game -we going to look down the game area from above fix the game 1. we click unto the game tab button, we can see the view of our game object or ship is completely not in the position that we wanted. 2. now we re-click unto the scene tab, and press ctrl + right mouse click (to do a zoom in out) 3. ok lets us play around and press alt and change the camera orbit position 4. we can see the position of the camera now is behind the player object, select the main camera in hierarchy explorer to view our camera preview.   5.reset the transformation value of the camera by, clicking the camera transformation setting button and choose "reset". 6. Change the camera view transformation rot...