-
-
Notifications
You must be signed in to change notification settings - Fork 21.7k
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
has_method()
claims method available, but invalid on call()
#87456
Comments
If I make the
This is not a change of behvaiour from 4.2 -> 4.3 - I'm just noting it's not just a static call issue |
I can confirm. The MRP above works fine when updating @tool
extends Node3D
static func test():
print("Hello From child") With that change, I personally think there should be an Editor-specific warning to let users know they are attempting to call functions from secondary scripts that the Editor expects to be in tool-mode as well but that are not, so that users know to update those scripts to be in tool mode. It seems reasonable to be able to run static functions from non-tool scripts however. |
I have a question related to autoload scripts. Personally, I feel, this is ridiculous to not able to create objects and call methods from a script without @tool mode specified. If it is so much limitation why not put the @tool mode at the project level. That way we game developers don't have to bother about @tool mode at each scene level but about other crashes and issues due to @tool mode |
I suggest the error message can add some extra hint like "you may have to add @tool to your script" if it detects the code running in tool mode. |
Tested versions
System information
Microsoft Windows [Version 10.0.22621.3007]
Issue description
Using
has_method
on a scene instance can result in atrue
result when the.get_script()
's script has the function, however if you then runcall()
it will errorSteps to reproduce
manager.gd
child.gd
Minimal reproduction project (MRP)
minimal-has-method-error.zip
The text was updated successfully, but these errors were encountered: