How to delete an object from another scene

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By StJ

I’ve a World scene with all the elements, and a scene called “Bullet”. The enemies create instances of the “Bullet” every x seconds. This bullet has to delete one of the hearts that represent the lives every time that touches the player. ¿How can I delete them if it’s a different scene?

Please don’t post the same question multiple times. Assuming it was an accident or misunderstanding, you can “hide” one of the instances - which you should do.

jgodfrey | 2022-08-22 16:31

Sorry, I didn’t notice. By the way, I know how to delete or hide elements, the problem is how to access them if they’re in another scene.

StJ | 2022-08-22 18:36

No, I meant that you should hide one of your 2 (duplicate) question instances. :slight_smile:

jgodfrey | 2022-08-22 18:46

:bust_in_silhouette: Reply From: godotisgreat

If you want to access nodes from another scene, you can probably inherit the scene so that they share the same nodes and scripts and then disinherit it (only if you want to prevent code from updating to both scenes).
I dont really know what your script consists of but this can be helpful when you want to share nodes from another scene.