- Edited
xyz The resource is used in such a design pattern:
I'm reimplementing my Unity solution for Godot. Just in case you are curious...
xyz The resource is used in such a design pattern:
I'm reimplementing my Unity solution for Godot. Just in case you are curious...
while-free- such a design pattern
It's an hour long video. Is there a TLDR?
xyz We'll see
For now the question is why resource_local_to_scene is not working in the addon project. I'll report my investigation if I find anything new.
while-free- Make a minimal project that reproduces it and you'll get the answer.
I got it. I did nothing wrong. This is a known issue in Godot:
https://github.com/godotengine/godot/issues/71243
I've been storing the resources in an array, and that's why the resource_local_to_scene = true did not work. Based on the solution from Calyad I fixed my problem. Here's his solution:
So here is my stupid bloody fix, now that I know about this... "feature."
Make two Array variables. Name one the thing you like ("Powers" or "Effects" or whatever), and name the other one similarly ("FakePowers" or "FakeEffects").
Export the Fake array, and make it the Array you actually want. Pretend for the moment that there is no bug.
When you load the node or instantiate it, make a recursive "duplicate(true) / resource_local_to_scene = true" function to copy all the resources from the Fake version of the array to the real version, which is not exported, and therefore works.
Have a cookie and seek out a hug. This has been a rough time for all involved.
while-free- I've been storing the resources in an array
You should have mentioned that in your question
xyz Not really, it makes absolutely no sense to "ignore" the resource_local_to_scene for items in an array. It's a several years old "bug" on Godot side.
But this won't make me stop loving Godot. There's always a work-around for anything, isn't it?
while-free- The issue discussion says it's fixed.
xyz I searched a bit more and there were people saying it's not fixed. But I didn't check it out myself; I want to keep backward compatibility, so I used the work-around solution. If you've checked it out for yourself please let us know.