![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | user721 |
When Light2D energy set to 0.5
Light2D’s script:
extends Light2D
var se = 0
func _physics_process(delta):
check()
func check():
se = self.energy
if se == 0.5:
print(1)
else:
print(0)
Output:
1
1
1
BUT when energy set to 0.7
extends Light2D
var se = 0
func _physics_process(delta):
check()
func check():
se = self.energy
if se == 0.7:
print(1)
else:
print(0)
Output:
0
0
0
Values of 0.6, 0.7, 0.8, and 0.9 results in the same. The debugger shows no error as well. What am I missing?