Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class Pad1 : MonoBehaviour {
  5.  
  6.     public Vector3 direction;
  7.     public float Speed = 10f;
  8.     // Use this for initialization
  9.     void Start () {
  10.        
  11.     }
  12.    
  13.     // Update is called once per frame
  14.     void Update () {
  15.         if (Input.GetKey(KeyCode.Z)) {
  16.             transform.Translate(new Vector3(0,0,1) * Time.deltaTime * Speed);
  17.         }
  18.         if (Input.GetKey(KeyCode.S)) {
  19.             transform.Translate(new Vector3(0,0,-1) * Time.deltaTime * Speed);
  20.         }
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement