fps1
작성자 : 진영훈
작성일 : 2023-12-08 13:34
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
public float speed = 5f;
void Update()
{
float horizontalInput = Input.GetAxis("Horizontal");
float verticalInput = Input.GetAxis("Vertical");
Vector3 movement = new Vector3(horizontalInput, 0f, verticalInput);
movement.Normalize();
Vector3 moveAmount = movement * speed * Time.deltaTime;
transform.Translate(moveAmount);
}
}