I have a script that decreases a float using the operator -= and I need it to stop at 0.
`
if(Input.GetKey(KeyCode.LeftShift) && acceleration <= 20 && sprintDuration >= 1)
{
acceleration = acceleration + sprintSpeed * Time.deltaTime;
sprintDuration -= 2 * Time.deltaTime;
}
else if(acceleration >= 15)
{
acceleration -= sprintSpeed * Time.deltaTime;
}
`