grass-rendering-prototype/Assets/Scripts/FreeCam.cs
2025-08-27 21:53:17 +02:00

20 lines
534 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FreeCam : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
transform.eulerAngles += new Vector3(-Input.GetAxis("Mouse Y"), Input.GetAxis("Mouse X"), 0);
transform.position += (transform.forward * Input.GetAxis("Vertical") + transform.right * Input.GetAxis("Horizontal")) * Time.deltaTime * 10f;
}
}