Projext/Assets/00001.Scripts/TestMove.cs

16 lines
341 B
C#
Raw Normal View History

2026-02-22 13:37:34 +00:00
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;
}
}