Getting the scene that the script's parent scene is instanced in

Godot Version

4.2.1 .NET

Question

Suppose I’m making a roguelike or something, and I have a weapon scene that’s supposed to spawn some sort of projectile, and that weapon scene is instanced inside the player scene, and that player scene is instanced inside the main world scene, how would I get the node that is the root node of the main world scene, inside the script on the weapon scene, so that I can spawn the projectile within the main scene, and not as a child of the weapon or player scene?

In short, how would I specify what scene I want to spawn something in anywhere within my “nested scene hierarchy” of sorts?

It would be helpful and appreciated if I could get an example in C# preferably, but I can manage either way.

you can spawn anywhere you want you just needed get node where you want spawn.
you can put reference in export or you use NodePath.
obraz