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

Binary file not shown.

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;
}
}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 251bece4d5a74464c8cd55c706ad3da2
guid: 9f11a522c76fd7f47b5a384fe75b3cab
folderAsset: yes
DefaultImporter:
userData: