hi, very new to unity but i was wondering if i could get a hand with the coding.
i’m making a script for a third person camera and it is following the player fine, however when i rotate the player the camera stays static and eventually the player faces the camera, i want the camera to rotate with the player.
i’m sure this is simple but i just need a helping hand to get started, here is my code:
using UnityEngine;
public class Camera_Follow : MonoBehaviour
{
public Transform target;
public float smoothSpeed = 0.125f;
public Vector3 offset;
void LateUpdate ()
{
Vector3 desiredPosition = target.position + offset;
Vector3 smoothedPosition = Vector3.Lerp (transform.position, desiredPosition, smoothSpeed);
transform.position = smoothedPosition;
}
}
i am aware that i could make the player a parent but i want the camera to have a slight delay between the player rotating and the camera.
thanks in advance!