Hello there,
So I wanted to make the following If statement:
if(SwingTime == 0.6f && SwingTime > 0.4f){
GUI.Box(new Rect(Screen.width/2-200,Screen.height/2-200,400,300),"",Pickaxe1);
}
else if( SwingTime == 0.4f && SwingTime >0.2f){
GUI.Box(new Rect(Screen.width/2-200,Screen.height/2-200,400,300),"",Pickaxe2);
}
else if( SwingTime == 0.2f && SwingTime >0){
GUI.Box(new Rect(Screen.width/2-200,Screen.height/2-200,400,300),"",Pickaxe3);
}
As you can see the max time is 0.6, however when it goes to 0.5 the image goes blank and none of the others are working.
What I’m trying to do in code is basically what you lean in basic math :
0.4 < X < 0.6 Where X = that image being displayed.
Can anyone assist me please?