func _ready() → void:
var tid:int = int(1)
print(typeof(1))
func _process(delta: float) → void:
pass`
in this simple script the output window prints 2 which is TYPE_REAL or float and not integer though the variable being integer. Game is about to launch soon and i am not able to fix this.Please help.
Not sure if this was intentional, but you seem to be doing:
print(typeof(1))
which is imputing a float instead of an int.
I had an issue with this as well at one point since I assumed godot would automatically use int if I did ‘var a = 1’ instead of ‘var a = 1.0’, which it didn’t. Had to write ‘var a : int = 1’ everywhere in my code.
If you want to do an int instead, I think this would work:
Where are you getting TYPE_REAL? What is the underlying issue you are facing, because I doubt your game is going to fail to launch because typeof(1) == 2