MY if statement is not getting executed.

I can’t figure out why this isn’t working. mpRayDuration is a variable defined in the top area of the code (I don’t know what to call it, but it’s outside of any function and visible in the inspector). Here’s the thing, when I press the P2mp button the mpRayDuration variable gets updated in the inpector so it is firing. It’s just not printing which leads me to believe the the if statement where (mpRayDuration <= Time.time) is the one that isn’t getting executed, for whatever reason.

if(Input.GetButtonDown("P2mp"))
	{
		mpRayDuration = Time.time + 1.2;

		if(mpRayDuration <= Time.time)
		{
			print("hi");
		}

I don’t know if it matters but the code above is already inside another if statement which in turn is inside a function that is inside the Update function. I don’t know if maybe having an if statement dependent on two others isn’t possible.

You set mprayduration to be 1.2 more than the time and immediately checks if it is less than the time. It will never be less than the time there since you are setting it to be more right before. I don’t know what you are actually trying to do so I do not have any suggestions as to what to change to solve it, but you need to change the logic in some way.