Player controller implemented.

This commit is contained in:
shakurass 2014-04-25 23:22:27 -06:00
commit 609f4e9269
51 changed files with 1139 additions and 2 deletions

View file

@ -0,0 +1,22 @@
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
void Update() {
}
void FixedUpdate() {
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);
rigidbody.MovePosition (rigidbody.position + movement * speed * Time.deltaTime);
rigidbody.freezeRotation = true;
}
}