Advertisement
Guest User

Untitled

a guest
Dec 17th, 2014
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class PlayerController : MonoBehaviour {
  5.  
  6. void FixedUpdate ()
  7. {
  8. float moveHorizontal = Input.GetAxis ("Horizontal");
  9. float moveVertical = Input.GetAxis ("Vertical");
  10.  
  11. Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
  12.  
  13. rigidbody.AddForce(movement*10);
  14. }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement