UnassignedReferenceException: The variable thingToFollow of FollowCamera has not been assigned.
You probably need to assign the thingToFollow variable of the FollowCamera script in the inspector.
FollowCamera.LateUpdate () (at Assets/FollowCamera.cs:12)
This is the error I keep receiving even though I have assigned the car as the thing to follow. The game works as intended so far with the camera following the car perfectly as I drive around, but I keep getting this error.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FollowCamera : MonoBehaviour
{
[SerializeField] GameObject thingToFollow;
// this things position (Camera) should be the same as the car's position
void LateUpdate()
{
transform.position = thingToFollow.transform.position + new Vector3 (0,0,-10);
}
}