0 votes

I have a static body parent scene that has a script with a single function in it, a sprite, and a collision poly 2D. All my prop objects inherit from that scene.

When trying to call a function from a bodyentered signal on the player, the signal fires and finds the correct prop (I can print the correct name with body.name), but the hasmethod check fails to find the function in the parent script.

So I added a print statement to the ready function of the parent static body scene, and it doesn't run. I have no idea why.

I tried using the _init() method, and that does run (and can call the custom function directly), but the _ready function does not run at all, and I cannot call the custom function from elsewhere. It's as if the script doesn't exist after init.

Am I missing something fundamental here? I feel like after a couple of years in Godot I might be losing my mind. Why on earth does the _ready method not run?

in Engine by (78 points)

This seems to be a bug. The system works as expected, but something must have got corrupted using my method of creating the inherited scenes. When I create a NEW inherited scene using the same methods, it works fine. However, my existing inherited scenes (which all have the same setup) don't work. Maybe because I duplicated them and changed the sprite and collision?

Either way, it's a "remake the scene" solution. No idea how to reproduce.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.