-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Invalid call. Nonexistent built-in function 'convert'." from script #5523
Comments
This happens because when the constructor fails, it returns a Which for GDScript means a non-existent function: godot/modules/gdscript/gd_function.cpp Line 98 in 36e7544
|
Anyway, the message is very, very misleading ^^ |
Still relevant in master |
In 0524853 the error says |
If casting allows to convert all supported The following produces equivalent result (3.2): func _ready():
print("Vector2(0, 0)" as int) # prints 200
print(convert("Vector2(0, 0)", TYPE_INT)) # prints 200 So I suspect casting uses the same conversion mechanism then (not sure why or how it converted |
Vector2(0, 0) -> 200 Also I tried using |
Operating system or device - Godot version:
Arch linux -- Godot master ( 119cd5d )
Issue description (what happened, and what was expected):
I was playing around with some code until
Invalid call. Nonexistent built-in function 'convert'.
came up.Steps to reproduce:
Edit: looks like one can't convert a
String
to aVector2
-- oops! Anyway, the error message is as misleading as possible, and would be nice if it is fixed ^^Link to minimal example project (optional but very welcome):
The text was updated successfully, but these errors were encountered: