unity how to make object follow a target code example
Example: how to make a gameobject follow another object's path
void Update()
{
transform. position = Vector3. Lerp(transform. position, target. position, speedPosition * Time. deltaTime);
transform. rotation = Quaternion. Slerp(transform. rotation, target. rotation, speedRotation * Time. deltaTime);
}