#Can a viewport display objects other than its children?
14 messages · Page 1 of 1 (latest)
I've tried a couple things already:
- Tried moving the camera outside the viewport's scope and used a script to assign the viewport to the camera with the custom_viewport property of the camera
- Set the camera's top_level to true
Neither worked.
For some context: I'm trying to make a minimap/radar. All tutorials I've seen involved instantiating sprites relevant to the objects that needed to be displayed to the minimap. This seems almost unnecessary to me so I'm wondering if it's impossible to display sprites outside a viewport's scope.
It took me hours to figure that out for 2d just recently
https://docs.godotengine.org/en/stable/tutorials/rendering/viewports.html#worlds
Introduction: Think of a Viewport as a screen onto which the game is projected. In order to see the game, we need to have a surface on which to draw it. That surface is the Root Viewport. SubViewpo...
are you talkin gabout this part?
wait i got it
holy crap it's workin. The world_2d was exactly what I was missing!
now there's a separate issue but it's probably not hard to solve
That player object has a sprite within it that's meant to specifically display in the subviewport. That sprite is in its own rendering layer. If I make the viewport only cull that layer it fails to display the sprite because the player object is in a different layer
That is a separate issue though, I got this. Marking this as solved. Much thanks!
(wait idk how to do that)
(nvm I got it)