Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Which is "better"
- // This:
- private var moveHorizontal : float;
- private var moveVertical : float;
- function Update () {
- moveHorizontal = Input.GetAxis ("Horizontal");
- moveVertical = Input.GetAxis ("Vertical");
- movement = Vector3 (moveHorizontal, 0.0f, moveVertical);
- transform.Translate (movement, Space.World);
- }
- // Or This:
- function Update () {
- var moveHorizontal = Input.GetAxis ("Horizontal");
- var moveVertical = Input.GetAxis ("Vertical");
- movement = Vector3 (moveHorizontal, 0.0f, moveVertical);
- transform.Translate (movement, Space.World);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement