-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Inconsistent treatment of load() from relative path #90029
Comments
This is because of a minor issue probably, the path is converted to The documentation should be clarified as well |
The documentation should probably be updated to say instead that: Or similar |
@AThousandShips That was my first thought as well, since (during the course of debugging this issue) I noticed that Godot prints the path as |
Indeed, see the linked issue, it's due to a specific path, this ensures that the loaded object is the exact same instance |
Tested versions
System information
Fedora Linux 37 (Workstation Edition) - X11 - GLES3 (Compatibility) - Mesa Intel(R) UHD Graphics 620 (WHL GT2) () - Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz (8 Threads)
Issue description
Godot seems to treat relative paths in
load()
calls very inconsistently. From the documentation for methodload
,So I would fully expect
load("./SomeScript.gd")
to returnnull
. However, it seems to do a sort of secondary load and produces a bizarre object distinct fromload("res://SomeScript.gd")
. See reproduction steps below.Steps to reproduce
Define a script file called
SomeScript.gd
whose contents areThen define the main scene
Main.gd
Based on the documentation, I would expect the
load("./SomeScript.gd")
lines to returnnull
. However, if that's not correct, then I would expect them to return the same object asload("res://SomeScript.gd")
. Currently, the two differentload
calls return distinct and incompatible objects, which just creates confusion.Minimal reproduction project (MRP)
LoadBug.zip
The text was updated successfully, but these errors were encountered: