typeof function returns a string?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By greenfrd

Image of the code next to the error.
Link to the image of code and error

if(typeof(actions[0]) == TYPE_VECTOR3):

The typeof function seems to be returning a string instead of a number which keeps resulting in an error.

:bust_in_silhouette: Reply From: Zylann

The line was misreported. Look at the else, you wrote:

elif(typeof(actions[0] == TYPE_STRING)):

Which is indeed comparing a string with an integer.

That bug has been around for a while: Debugger reports wrong error line · Issue #20820 · godotengine/godot · GitHub

thank you. dumb mistake

greenfrd | 2020-06-03 21:06