I am trying to display a 3D camera viewport texture on a 2D sprite. The sprite shows the correct texture on starting, but then doesn’t update every frame to show what the camera is showing. I have tried passing the texture to a TextureRect too but the result is the same.
extends Sprite
onready var viewport = get_parent().get_node("player/Viewport")
func _process(delta):
set_texture(viewport.get_texture())
The entire 3D world is put as a child of the Viewport. Then use a TextureRect and set the texture to “New Viewport Texture” > said viewport in the the inspector. I don’t really understand why my solution didn’t work before, but this is certainly easier!