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.