0 votes

I have a world with sprite objects in it. These objects may be a great distance apart but may overlap on screen at some point due to reasons. I have two Viewports for this purpose. I want the Viewports to respect the object's Z-Levels, regardless of which Viewport is higher/lower in the node tree. As it currently stands, the Viewports are treated like their own canvases and draw the objects like layers in Photoshop.

For example, if I have Object A in Viewport 1, and Object B in Viewport 2.
Object A has a Z level of -10, Object B has a Z level of +10. If Viewport 1 is lower in the scene tree then Object A renders on top of Object B, despite having a lower Z level. I need to avoid this. I need the Z-levels respected regardless of where the Viewport is in the node tree.

This may not be possible at all, or it may have more to do with Cameras or Canvases than Viewports, but it's a linchpin of my current project and will tank the whole thing if I can't resolve the visual glitches that result.

Godot version 3.3.3
in Engine by (24 points)

Please log in or register to answer this question.

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.