Advertisement
DRAWNBOX

stttet

Jul 28th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.55 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4.  
  5. public class CScript : MonoBehaviour
  6. {
  7.     public float movingSpeed = 10.0F;
  8.     // Use this for initialization
  9.     void Start()
  10.     {
  11.  
  12.     }
  13.  
  14.     // Update is called once per frame
  15.     void Update()
  16.     {
  17.         float translationx = Input.GetAxis("Vertical") * movingSpeed;
  18.         float translationy = Input.GetAxis("Horizontal") * movingSpeed;
  19.         translationx *= Time.deltaTime;
  20.         translationy *= Time.deltaTime;
  21.         transform.Translate(translationy, 0, translationx);
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement