



Reply From: 
nwgdusr999 
“that the expression should return false”. That which expression should return false? z != 0? The if/else code looks ok to me. Try this, I’m also new, but I have a feeling it might be a type thing; this output could help, if not, might help you debug also, as your issue might not be in that part of the code.
func _process(delta):
if Input.is_action_pressed("MainEngine"):
$"MainEngine".visible = true
z = 0.1
$"../METimer".start()
else:
$"MainEngine".visible = false
print (str("z=", z))
print (str("z!= is ", z != 0))
print (str("z!= is ", z != 0.0))
if z != 0.0:
if isMEStopped == true:
if z > 0:
z = 0.1
else:
z += 0.1
else:
print("timer is on")
Hi thanks for your debugging ideas,
by expression I mean if z != 0:
look at the output it loops although it is getting to 0 but the expression is not evaluating it properly this is the code again
func _process(delta):
if Input.is_action_pressed("MainEngine"):
$"MainEngine".visible = true
z = 0.1
$"../METimer".start()
else:
$"MainEngine".visible = false
print (str("z=", z))
print (str("z!= is ", z != 0))
print (str("z!= is ", z != 0.0))
if z != 0:
print (z)
if isMEStopped == true:
if z > 0:
z = 0.1
else:
z += 0.1
else:
print("timer is on")
and here is the output I had to remove some parts so it is shorter
z=0
z!= is False
z!= is False
z=0
z!= is False
z!= is False
z=4.2
z!= is True
z!= is True
4.2
timer is on
z=4.2
z!= is True
z!= is True
4.2
timer is on
z=4.2
z!= is True
z!= is True
4.2
timer is on
z=4.2
z!= is True
z!= is True
4.2
z=3.9
z!= is True
z!= is True
3.9
z=3.8
z!= is True
z!= is True
3.8
z=3.7
z!= is True
z!= is True
3.7
z=3.6
z!= is True
z!= is True
3.6
z=3.5
z!= is True
z!= is True
3.5
z=3.4
z!= is True
z!= is True
3.4
z=3.3
z!= is True
z!= is True
3.3
z=3.2
z!= is True
z!= is True
3.2
z=3.1
z!= is True
z!= is True
3.1
z=3
z!= is True
z!= is True
3
z=2.9
z!= is True
z!= is True
2.9
z=2.8
z!= is True
z!= is True
2.8
z=2.7
z!= is True
z!= is True
2.7
z=2.6
z!= is True
z!= is True
2.6
z=2.5
z!= is True
z!= is True
2.5
z=2.4
z!= is True
z!= is True
2.4
z=2.3
z!= is True
z!= is True
2.3
z=2.2
z!= is True
z!= is True
2.2
z=2.1
z!= is True
z!= is True
2.1
z=2
z!= is True
z!= is True
2
z=1.9
z!= is True
z!= is True
1.9
z=1.8
z!= is True
z!= is True
1.8
z=1.7
z!= is True
z!= is True
1.7
z=1.6
z!= is True
z!= is True
1.6
z=1.5
z!= is True
z!= is True
1.5
z=1.4
z!= is True
z!= is True
1.4
z=1.3
z!= is True
z!= is True
1.3
z=1.2
z!= is True
z!= is True
1.2
z=1.1
z!= is True
z!= is True
1.1
z=1
z!= is True
z!= is True
1
z=0.9
z!= is True
z!= is True
0.9
z=0.8
z!= is True
z!= is True
0.8
z=0.7
z!= is True
z!= is True
0.7
z=0.6
z!= is True
z!= is True
0.6
z=0.5
z!= is True
z!= is True
0.5
z=0.4
z!= is True
z!= is True
0.4
z=0.3
z!= is True
z!= is True
0.3
z=0.2
z!= is True
z!= is True
0.2
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
0
z=0.1
z!= is True
z!= is True
0.1
z=0
z!= is True
z!= is True
The_Patriot  20190522 19:17
I have also flipped the logic like this
unc _process(delta):
if Input.is_action_pressed("MainEngine"):
$"MainEngine".visible = true
z = 0.1
$"../METimer".start()
else:
$"MainEngine".visible = false
print (str("z=", z))
print (str("z == is ", z == 0))
print (str("z == is ", z == 0.0))
if z == 0:
print ("expression is true")
else:
print ("expression is false")
if isMEStopped == true:
if z > 0:
z = 0.1
else:
z += 0.1
else:
print("timer is on")
there are two bugs I think
 the editor returns false print for (!=)
 the float expressions are evaluated oppositely sometimes
The_Patriot  20190522 19:29
As workaround I had to use this expression if z < 0.1 && z > 0.1:
instead
read another thread that it is because of the floating point are not showing fully in the editor, hope the developers will solve this soon
Thanks for all of you
The_Patriot  20190522 19:41