spatial 3D world to viewport: How to create and assign the "new ViewportTexture"?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By MikeMikeMike

Hi…,

I want to project my 3D spatial world to a viewport, like described here:

I don’t understand this description: “Or it can be assigned in the editor by selecting “New ViewportTexture””

Where can I create and assign the “New ViewportTexture” to the viewport? In the Inspector, but where, and how?

Any help is appriciated. Thanks

Mike

:bust_in_silhouette: Reply From: Inces

You have it in the image below. Wherever you set texture in editor for any object ( sprite, control nodes) You get to choose what kind of texture it will be. One of those textures is viewporttexture. The same goes for simply calling ViewportTexture.new() in script.

You dont assign viewporttexture to the viewport, viewport is source of viewporttexture.
What do You mean You want to project 3d space to viewport ? WHat do you exactly want to happen ?

Hi Inces,

I have this scene:

+-Node2D
 +-Viewport
  +-Spatial
   +-Camera
   +-MeshInstance

I am too dumm, where to create the “New ViewportTexture”? Is it in the Inspector or in the Scene? Where to click for “New ViewportTexture”? I don’t get it.

Thanks

Mike

MikeMikeMike | 2021-11-19 08:42

Hi Inces,

I’ve found it. I have forgotten to create a Sprite node. In the sprite Texture I can create my “New ViewportTexture”

Thanks

Mike

MikeMikeMike | 2021-11-19 09:34