Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Movement : MonoBehaviour {
- //remember to change the speed in Unity!
- public float speed = 0.0f;
- // Update is called once per frame
- void Update () {
- //variables for location
- float x = Input.GetAxis("Horizontal");
- float y = Input.GetAxis("Vertical");
- float z = Input.GetAxis("Mouse ScrollWheel");
- //change the value of the location
- x = x*Time.deltaTime*speed;
- y = y*Time.deltaTime*speed;
- z = z*Time.deltaTime*speed*25;
- //change the actual location
- transform.Translate(x,y,z);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement