Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PlayerMovement : MonoBehaviour {
- public float speed = 5f;
- void Update()
- {
- float x = Input.GetAxis ("Horizontal");
- rigidbody2D.velocity = new Vector2 (x * speed, rigidbody2D.velocity.y);
- }
- }
Add Comment
Please, Sign In to add comment