How to detect if a scene was added as a child of another one

Godot Version

4.3

Question

I am making a bullet heaven type game. I need to make a function that happens when the bullet scene is made (it's not there at the beginning of the game/scene, so _ready won't work)

Could you explain a bit more?
Why wouldn’t ready work? Is the code not meant to run in the bullet script, but in another?
You could add a signal emitted from the bullet at ready and connected to whichever function.
Difficult to give any advice without knowing what you want to do.

Perhaps you should use _enter_tree() instead of ready then.

The script is meant to run in a bullet scene that’s added to a main scene using a script that’s in a hand script. The bullets are made with an add_child command

The scene is made when you call instantiate(). So whatever you want to do, you can do it there, right after you call instantiate().

Okay, nevermind, I fixed it. I had too many scenes inside each other and that made things weird