If statement on float number not working
I'm working on a script that moves the camera based on the players' speed. I can get the speed of the player:
void Update()
{
CarSpeed = Mathf.Round(velMag * 2.23694f) *1f;
Debug.Log(CarSpeed + "MPH");
}
Works like a charm and spits out the correct speed. So I wanted to check if a certain speed was reached. I've got public float minSpeed and public float maxSpeed that I can manually set. minSpeed is gonna be used for the closest distance. maxSpeed is gonna be used for the furthest distance. So if the car drives 10mph for instance the camera is close and if it goes faster the camera moves further to the back. But before implementing that I wanted to check if a certain speed has been reached so I added this to void Update:
if (CarSpeed >= minSpeed) ;
{
Debug.Log("Zoom");
}
I guessed that would work. The script calculates the speed perfectly but somehow de debug log keeps spitting out 'Zoom' no matter what the speed is, even if the car is standing still. Anyone know what I'm doing wrong here?