if(float == Time.time) not working, why?

I assume that maybe Unity is skipping over a few numbers and is missing the number that it is supposed to match. I have noticed that Time.time has like 5 numbers after the period so that could explain why. However I will ask first before trying to work around the problem. I was also think about maybe using clamp to say if(float == (any number inside the clamp)) but this probably wont work. I have other solutions that WILL work but I want to try using == Time.time first. Here’s some code to help you understand

var hpRayStall : float;
Update(){
if(Input.GetButtonDown("P2hp"))
		{
			hpRayStall = Time.time + 2;
		}
		if(hpRayStall == Time.time)
		{
			var hpRay = Physics.Raycast(lp.transform.position, transform.TransformDirection(Vector3.right), 2);
		}
		if(hpRay)
		{
			sceneManager.GetComponent(SceneManagerScript).p1HP -= 6;
		}

I think you may find that a coroutine will work better. I’m thinking that maybe your problem is due to the fact that Time.time might not ever be exactly the number that you are looking for because of the small gap between each update. If you put this in a coroutine, you can guarantee the execution of the code.