Godot Version
v4.2.2.stable.mono.official
Question
I am attempting to render 3D elements inside of a 2D UI. Here’s my current setup:
I have an InvetorySlot
scene with the following layout:
My intent here is for the texture rect to show a 3D model, which is added to the ItemAnchor
node within the SubViewport
. The TextureRect
has a SubviewportTexture
which is linked to the SubViewport
in the scene, and is also marked as “Local to Scene”:
Then, one level up I have a Invetory
scene, with 10 of these InvetoryItem
s as children:
The result should be a 10 item inventory, each slot with distinct renders / textures. This almost works. However, when I add an item to one of the slots, all slots show the same texture:
Looking at the scene tree, the item is added to only the expected slot, and each ViewportTexture
seems to be a unique instance:
I for the life of me cannot figure out why these textures always end up being the same! I’ve tried various hacks of trying to duplicate the textures in code, but get a pink box whenever doing that. Does anyone have any advice?
All images here due to new user embed limit: Godot SubViewport Debugging - Album on Imgur