Why is this if-statement returning true?

Hello! I have a really weird issue.

The following code is always printing the Debug.Log code. Even when distance is greater than range. Why is that if-statement always returning true? What am I missing? The Debug.Log always prints the distance and the range. If it is “1/10” that is correct since its below range. But it also prints “3242/10” if i stretch the objects apart. It’s never false.

Thanks in advance for any help!

	private IEnumerator DoActions()
	{
		float distance;
		while(target)
		{
			distance = Vector3.Distance(transform.position, target.transform.position);
			if(distance < range);
			{
				Debug.Log (distance + "/" + range);
				//Do things
			}
			yield return null;
		}
	}

Here:

if(distance < range); <-----

you have a semicolon after your if. That will terminate it at the same line. So the following block doesn’t belong to the if statement at all. Just remove that semicolon ^^.