Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. public class CharacterMovement : MonoBehaviour {
  6.  
  7.     public float moveSpeed = 10f;
  8.  
  9.     void Update () {
  10.         Vector3 movement = new Vector3();
  11.  
  12.         movement.x = Input.GetAxis("Horizontal");
  13.         movement.z = Input.GetAxis("Vertical");
  14.  
  15.         this.transform.Translate(movement * moveSpeed * Time.deltaTime);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement