#Can a viewport display objects other than its children?

14 messages · Page 1 of 1 (latest)

winged glen
#

Essentially I just want the viewport to display the player sprite that is outside its scope. I'm not looking for alternative methods to display the player, I am aware of them. I just want to know if it's possible to get the viewport to display the player with this setup.

#

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.

signal igloo
winged glen
#

are you talkin gabout this part?

signal igloo
#

Yup

#

I can give you exact code in a minute

winged glen
#

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)