hi, I'm using unity and I'm trying to create a racing game and I want to know how to make the camera rotate when my car does? @galactic001

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class FollowPlayer : MonoBehaviour
{

public GameObject player;
private Vector3 offset = new Vector3(0, 2, -5);

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void LateUpdate()
{
 transform.position = player.transform.position + offset;   
}

}

After line 15 you could add

transform.rotation = player.transform.rotation;

But I would say rather than using a script at all, you could just place the camera as a child of your player in the hierarchy, then it will perfectly follow along without any code.