0 votes

Today I discovered Godot actually sets up runtime nodes. You can see what I mean below:

godot debug remote nodes

When I run the game with debugging options, I can see these nodes under "Remote" tab in scene dock. So, that got me wondering... When I GetNode, do I actually access these runtime nodes?

To give an example, consider these three seperate scenes:

Foo
> foo: Node2D

Bar
> bar: Node2D

Container
> container: Node2D
>> foo: Node2D (injecting Foo)
>> bar: Node2D (injecting Bar)

In this case, Container scene is parent and importing/injecting foo and bar. So, in Foo.cs, can I access the injector, which is container node, as below:

// Foo.cs
Node2D container = (Node2D)GetNode("/root/container");

Or will this fail?


Environment

  • Godot Mono 3.2
  • Mono JIT Compiler 6.4.0
  • Manjaro 19.0.2
in Engine by (18 points)

1 Answer

0 votes

This seems to be the case, which means GetNode actually gets runtime nodes. That's actually good since I plan to keep the tree consistent during the gameplay so that I can access several things such as faders and loaders.

by (18 points)
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 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 webmaster@godotengine.org with your username.