Hi there, well its is exactly what title says :) I added hp_bar to my enemy. For that i used sprite3d and texture progres bar. Its works nicely. For update the texture i did use this code at hp_bar sprite3d:

func _ready():
	texture = $Viewport.get_texture()

This is hp_bar nodes:

This is my viewport node settings:

Every second i have one enemy got instance and total of 30 of them. And whenever one got instanced its get updated i suppose, not sure if it is because of viewport, this is my first time using this node, but its looks like it. When an enemy get instanced, a little stop happening.

This is how its look like:

https://streamable.com/r5eahv

How can i solve this. Because i will have a loot of enemy that slowly get instanced at the nexts steps of the game, and this will not be look nice :)

Why not use CanvasLayer instead? Viewport seems awfully overkill for this. If I understand the purpose correctly, anyways.

Thank you for anwser. I didnt use before canvaslayer either, can you give me a little example. How can i use it at this setup.

Should i update it like i did viewport, or its work difrently ?

A canvas layer should not require any special interaction for updating. To be quite honest I'm not sure why you even felt the need to use a viewport just to hold a texture progress bar...

edit: Ah I see, initially it looked like a 2D game. It makes more sense now. A viewport rendering a texture progress bar is an option but I think you might be better off just applying a custom shader to the Sprite3D node turning the node itself into a progress bar. You would simply need to write custom logic to update the shader input values so it would update accordingly.

It is a 3d top down game yeah :)

and as i know what is a shader is, im not good at codding it, if possible i wanna solve this while using this set up. Still don't understand why there is a little stop while enemies get instanced.

2 years later