Advertisement
Guest User

Untitled

a guest
Oct 7th, 2014
6,808
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.39 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. public class move : MonoBehaviour {
  4.  
  5.     public float speed = 0.18f;
  6.     public float jumph = 4.01f;
  7.  
  8.     void Start () { print ("Start"); }
  9.  
  10.     void Update () {
  11.  
  12.         Vector3 dp = new Vector3();
  13.  
  14.         if (Input.GetKey (KeyCode.Q)) {
  15.             dp.x -= speed;
  16.         }
  17.  
  18.         if (Input.GetKey (KeyCode.D)) {
  19.             dp.x += speed; 
  20.         }
  21.  
  22.         transform.position += dp;
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement