BITFALL/Assets/VectorAssets/Realistic Scope Effect V2/Scripts/CameraFreeCam.cs

16 lines
446 B
C#
Raw Normal View History

2023-11-02 20:58:55 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CameraFreeCam : MonoBehaviour
{
public float Speed = 5;
void Update()
{
if (!Input.GetKey(KeyCode.LeftAlt))
transform.Translate(Input.GetAxisRaw("Horizontal") * Speed * Time.deltaTime, Input.GetAxisRaw("Vertical") * Speed * Time.deltaTime, Input.GetAxisRaw("Mouse ScrollWheel") * Speed * 100 * Time.deltaTime);
}
}