Added linear movement system
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user