set rotation of object moving in circle

ive looked at the answers on these forums however there must be an easier way, im moving an object in a circle and am simply trying to rotate the object on the z axis to follow the circular motion. (a car traveling in circle) i tried subtracting the transform.position from the target position, to return a vector, however am unsure how to add that vector simply to the z axis of the object because the difference vector has values for x and y and 0 value for z. i bet the answer is really simple because the (local) rotation should remain the same the entire time its rotating around the circle, right?

public Transform pivotPoint;

public float speed = 1;
public float circumference = 4;

public float count = 0;

Vector3 previousPosition;

void Update()
{
    count += Time.deltaTime * speed;

    var x = Mathf.Cos(count) * circumference;
    var y = Mathf.Sin(count) * circumference;

    Vector3 targetPosition = new Vector3(x, y, 0);

    transform.position = targetPosition + pivotPoint.position;
}

Depending on the complexity of what you are trying to set up, theres always the option of making your car a child of a game object, offsetting its position, and rotating the root parent. The car will appear to be moving in a circle and you wont have to worry about the direction it should be facing.

You can set either transform.up or transform.right to that targetPosition - transform.position vector depending on how your object is oriented.

didn’t know rotateAround was a thing… this code seems to kinda work, however the front of the car is facing the center, rather than the side. any suggestions?

 transform.RotateAround(pivotPoint.position, Vector3.forward, Vector3.Angle(targetPosition, transform.position));