Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class NewBehaviourScript : MonoBehaviour {
- public Vector2 speed = new Vector2 (50, 50);
- void Update () {
- float inputX = Input.GetAxis ("Horizontal");
- float inputY = Input.GetAxis ("Vertical");
- Vector3 movement = new Vector3 (speed.x * inputX, speed.y * inputY, 0);
- movement *= Time.deltaTime;
- transform.Translate (movement, Space.World);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement