Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | Samsong1018 |
I am new to Godot so I hope I am not just missing something.
I have a variable assigned to a bool. I have an if statement checking wether or not it is false. I have it set true when my player is not on the ground. and false when it is on the ground. I have printed it through my script and it works fine. but after the if statement it is always set to false.
var my_var = false
if my_var == false:
do something here.
in my if statement it is always false. but never anywhere else. I check my variable in other locations and it always does this. I am on Mac with Godot vs. 3.2.1
Hi,
the code you are providing is just fine. It surely is a logical flaw in your code. You have to show us more of your code to get any help.
klaas | 2020-09-03 20:05
Agreed. The problem is definitely in your code. Rather than trying to explain what you think your code is doing, just post it here so we can see it.
As Klass mentioned, there is nothing wrong with the sample you posted. I assume the variable is being set / reset elsewhere in your code, but we can’t determine that without the code.
jgodfrey | 2020-09-03 23:53
same problem bro.
Bagasito | 2022-11-25 23:31