Topic was automatically imported from the old Question2Answer platform.
Asked By
CensedPie
I am looking for a way to setup something like the TextureProgress node in my 3D environment, perhaps with Sprite3D. The effect I want to achieve is a 2D radial bar in a 3D space which I can place in 3D. I don’t need it to billboard, just to be able to set it facing in a direction.
What should I be using to achieve this effect and can I use a TextureProgress node at all?
I’ve found a tutorial which doesn’t explain it that well but I managed to follow it,
It uses a mesh and then a viewport on the mesh to render 2D UI onto a mesh.
However now I am unsure how I can map the texture to spread across the whole mesh. In my instance the texture is set to the lower right of the mesh and I am unsure why.
EDIT: I had to set the viewport to render smaller. I will post my setup here in a bit.
Now setup your Viewport to half the size of the image you want to use or text. In my case my Texture Progress node uses a 64x64 image so I setup my Viewport size to 32x32. If your text or image is off center on the mesh or really small and not as big as the mesh, fiddle with this setting. The idea is that the viewport renders the 2D image on the 3D mesh so this will affect your 2D image size when rendered.
Still in the Viewport inspector, change:
Size - Described above
Transparent Bg - On
Hdr - Off
Usage - 2D No-Sampling
V Flip - On
Finally add your GUI node/nodes (you can include control nodes I think)
Last but not least you need to setup a script somewhere else to call the Update function from the Mesh script we made. I did this with a parent node by adding some script to it.
onready var m_RadialUI = $GUIInteraction
You can change GUIInteraction to the name of your Mesh Instance node where the previous script is.