Here’s My Code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player_Lean : MonoBehaviour
{
public Transform Player;
public Camera MainCam;
public Camera LeanCam;
public KeyCode Key;
void Start()
{
LeanCam.gameObject.SetActive(false);
MainCam.gameObject.SetActive(true);
}
void Update()
{
if (Input.GetKey(Key))
{
LeanCam.gameObject.SetActive(true);
}
else
{
LeanCam.gameObject.SetActive(false);
}
}
}
As The Title Says, How Would I Make My Character Lean Forward Smoothly When The “R” Key Is Pressed?