Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class Movement : MonoBehaviour {
- float speed = 1.0f;
- Rigidbody2D playerRigidbody;
- void Start(){
- playerRigidbody = GetComponent<Rigidbody2D>();
- }
- void Update() {
- playerRigidbody.AddForce(new Vector2(Input.GetAxis("Horizontal") * speed, Input.GetAxis("Vertical") * speed));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment