Character moving

Hi,

I have 2 characters and one car. I want to do when the car reaches a certain z position like -0.02 or 0.02. the characters need to start walking. Before that character will be stopped at that place. here is my full code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.VFX;

public class CharaterNavigationCntroller : MonoBehaviour
{
	public float movementSpeed = 0.5f;
	public float rotationSpeed = 120f;
	public float stopDistance = 1f;
	public Vector3 destination;
	public Animator animator;
	public bool reachedDestination;

	private Vector3 lastPosition;
	Vector3 velocity;

	public Transform car;
	//0.34936   last point: 0.4864168
	private void Awake()
	{
		movementSpeed = Random.Range(0.1f,0.2f);
		animator = GetComponent<Animator>();
    }
	void Update()
	{
		if (car.transform.position.z >= 0.34936f)
		{
			animator.SetBool("IsWalking", true);
			if (transform.position != destination)
			{
				Vector3 destinationDirection = destination - transform.position;
				destinationDirection.y = 0;

				float destinationDistance = destinationDirection.magnitude;

				if (destinationDistance >= stopDistance)
				{
					reachedDestination = false;
					Quaternion targetRoation = Quaternion.LookRotation(destinationDirection);
					transform.rotation = Quaternion.RotateTowards(transform.rotation, targetRoation, rotationSpeed * Time.deltaTime);
					transform.Translate(Vector3.forward * movementSpeed * Time.deltaTime);
				}
				else
				{
					reachedDestination = true;
				}

				velocity = (transform.position - lastPosition) / Time.deltaTime;
				velocity.y = 0;
				var velocityMagnitude = velocity.magnitude;
				velocity = velocity.normalized;
				var fwdDotProduct = Vector3.Dot(transform.forward, velocity);
				var rightDotProduct = Vector3.Dot(transform.right, velocity);

				animator.SetFloat("Hornizontal", rightDotProduct);
				animator.SetFloat("Forward", fwdDotProduct);
			}

			//lastPosition = transform.position;
			else
			{
				reachedDestination = true;
			}
		}
		else
        {
			animator.SetBool("IsWalking", false);
        }
	}
	public void SetDestination(Vector3 destination)
	{
		this.destination = destination;
		reachedDestination = false;
	}
}

Does anyone have an idea how can I approach this idea in unity?

“All characters are made in Fuse and mixamo software”.

After placing the cube at a point you want the car to reach, close the mesh renderer of the cube.
Don’t forget to add colliders to your car and your cube!
To detect the collision inside the cube (car vs cube collision)
write the required codes
Note: If your car is a solid substance, ie your player dies when it hits the player, the code you need to write to detect the collision is the one with OnCollisionEnter.
But if it’s not a solid substance then your car is the OnTriggerEnter code.
After checking if there is a collision, the code you need to write inside your players has this collision happened?
if move on, if not, keep stopping