If two viewports share the same world, can I add_child() to one viewport and have it show up in the other?

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

I want to draw multiple nodes to the same World2D.

I have multiple viewports that all share the same world 2D

Can I add a child to one arbitrary viewport (not just the one that owns the world) and have it display in another?

What if I set one world equal to another AFTER I add the node to the Viewport?

My use case: I have 2d sprites showing up in a 3d game. I have to put each 2d sprite in a viewport texture so that I can draw effects on top of it. However, in this way each sprite gets its own draw call and is immune to batching. I want to be able to draw all sprites to the same viewport texture so I can batch them, so I’m trying to find an easy way to do this.

:bust_in_silhouette: Reply From: BAE

NVM, looks like you CAN do this, but you have to re-add the child to the viewport when you change world_2d.