-
Notifications
You must be signed in to change notification settings - Fork 27
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
can't hold resource?!?!?!? #41
Comments
ok i realized that the issue is that reference-counting doesn't work for lua vars, pushing the resource into a reference array works as the resource stays referenced in gdscript. |
While in theory this should work godot gets touchy when it dosnt own the memory. I will need to do some testing to figure out what the best method of resource loading from lua would be. In a ideal world lua wont own the resource but only have a reference to it. Sometimes lua owning the resource is fine but it also can cause lots of issues. |
As mentioned here the issue is with RefCounted specifically. We currently do not test if the object being passed is a RefCounted or not. |
I found out we are able to use metatables on lightuserdata. So that is what we are doing. |
pretty big issue i've been running into, it's seemingly impossible to load resources.
i print the resource and godot just says
[Object:null]
here's my sample code
load_texture
returns a Texture2D, though no resource i've tried works. i haven't tried custom resource yet but that would be seriously damning, for the texture example i can just write a function that returns a sprite and loads the texture from the path onto the TextureRect's texture property but that isn't always an option for some of my game's resources.please tell me if it works on your end, for all i know it's just because my build of godot 4 is a little out of date 😅 (waiting until a few specifics PRs are merged...)
The text was updated successfully, but these errors were encountered: