Added linear movement system

This commit is contained in:
Atlas
2020-02-17 22:27:07 +00:00
parent 7e7e6c227b
commit 31f45646a6
53 changed files with 576 additions and 79 deletions
+4 -3
View File
@@ -5,7 +5,8 @@ using UnityEngine;
public class PlayerController : MonoBehaviour {
public float speed;
Vector3 direction;
public float speed = 0.5f;
#if tmp
public GameObject bullet;
#endif
@@ -17,7 +18,7 @@ public class PlayerController : MonoBehaviour {
// Update is called once per frame
void Update() {
gameObject.transform.position += new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"), 0);
gameObject.transform.position += new Vector3(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical"), 0)*speed;
if (Input.GetButton("Fire1")) gameObject.BroadcastMessage("Fire");
}
}