System for Moving the Object with WASD or Arrow Keys in Unity

Опубликовано: 06 Июнь 2026
на канале: Technology Hub
42
1

You can support our new channel by subscribing.

Code:
public float speed=10f;

void Update()
{
float xHorizontal = Input.GetAxis("Horizontal");
float zVertical = Input.GetAxis("Vertical");
Vector3 moveSystem = new Vector3(xHorizontal, 0.0f, zVertical);
transform.position += moveSystem * speed * Time.deltaTime;
}