Hi ! I'm trying to create a 4-star review UI and depending on the number of stars, I display either the empty star image or the full star image. Therefore I change the TextureRect.texture property via the code but it does not work.

In the following screenshot, you can see the code and the debugger showing the images preloaded

In this one you can see the content the debugger that display an empty texture.

What is going on? Am I doing something wrong?

This happened because I was calling initialize() before the parent.add_child() so the nodes are not existing yet.

2 ways to fix this: - call initialize() after parent.add_child() - wait for ready signal yield(self, "ready") in the initialize()

I wasn't aware of such a situation but that explains a lot of past behaviour I encountered. I think godot absorbing the error is quite annoying. I'd rather have godot crashing on me.

7 months later