|Topic was automatically imported from the old Question2Answer platform.
I have a simple 2d game in which i want to make a minimap.
I use a viewport with a script that tells it in _onready:
world_2d = get_tree().get_root().world_2d;
When i use this, my game is not rendered inside the minimap viewport , however the minimap can work if i put my game elements in a custom(as in, not the root viewport) viewport, and tell my minimap viewport to set its world to the custom viewport’s one.
export(NodePath) var targetViewport;
world_2d = get_node(targetViewport).world_2d;
i am really wondering why setting the minimap viewport’s world2d to that of an added viewport works but setting it to that of the root viewport doesn’t.