Projext/Assets/00001.Scripts/TestMove.cs
2026-02-22 22:37:34 +09:00

16 lines
341 B
C#

using UnityEngine;
public class TestMove : MonoBehaviour
{
public float speed = 5f;
void Update()
{
float h = Input.GetAxis("Horizontal"); // A / D
float v = Input.GetAxis("Vertical"); // W / S
Vector3 move = new Vector3(h, 0, v);
transform.position += move * speed * Time.deltaTime;
}
}