Advertisement
LeeMace

Focal Point Camera Rotation

Feb 10th, 2023
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | Gaming | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4.  
  5. //Create empty game object and call it focal point. Make the camera a child of this.
  6. public class RoatateCamera : MonoBehaviour
  7. {
  8.     public float roatationSpeed;
  9.  
  10.     void Start()
  11.     {
  12.        
  13.     }
  14.  
  15.     void Update()
  16.     {
  17.         float horizonatalInput = Input.GetAxis("Horizontal");
  18.         transform.Rotate(Vector3.up, horizonatalInput * roatationSpeed * Time.deltaTime);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement