diff --git a/Assets/02_Scripts/PlayerController.cs b/Assets/02_Scripts/PlayerController.cs index 779e879..a5bdfba 100644 --- a/Assets/02_Scripts/PlayerController.cs +++ b/Assets/02_Scripts/PlayerController.cs @@ -7,6 +7,8 @@ public class PlayerController : MonoBehaviour private float h; private float v; + public float moveSpeed = 5.0f; + void Start() { @@ -16,15 +18,10 @@ public class PlayerController : MonoBehaviour { h = Input.GetAxis("Horizontal"); // 1차원 연속값 -1.0 ~ 0.0 ~ +1.0 v = Input.GetAxis("Vertical"); // -1.0f ~ 0.0f ~ +1.0f - // Debug.Log("h=" + h + " v=" + v); - Debug.Log($"h={h} / v={v}"); - - // transform.Translate(Vector3.forward * v * 0.05f); - // transform.Translate(Vector3.right * h * 0.05f); // 벡터의 덧셈연산 => 벡터의 정규화 (Vector Normalized) Vector3 moveDir = (Vector3.forward * v) + (Vector3.right * h); - transform.Translate(moveDir.normalized * Time.deltaTime * 5.0f); + transform.Translate(moveDir.normalized * Time.deltaTime * moveSpeed); } }