Free Look Camera in unity easy tutorial
Channel:
Subscribers:
1,110
Published on ● Video Link: https://www.youtube.com/watch?v=kOF0S-FFcBc
in this video i have shown how to develop free look camera in unity3d
Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FreeLookcam : MonoBehaviour
{
public Vector3 speed;
float xRot, yRot;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
xRot += Input.GetAxis("Mouse X") * Time.deltaTime*speed.x;
yRot -= Input.GetAxis("Mouse Y") * Time.deltaTime*speed.y;
transform.localEulerAngles = new Vector3(yRot,xRot,0f);
}
}
Other Videos By Muhammad Shahzaib
Tags:
unity
unity3d
leran unity
unity tutorials
free look camera in unity
unity camera
unity coding easy