Widget Component slow performance

Hi, I’d like to display the life of a tree after I hit it.
To do that, I created an actor blueprint composed with a simple tree shape, and a widget component hidden at start.

The problem is I have an important lag when I add my health widget.
Ok, I have about 9 000 trees, but the widget is not visible so I don’t understand where is the calculation.

In the screen below, I tried to create a simple widget component without adding my health widget class, and I disabled all functionalities I could on the details panel.
It doesn’t change anything, there are still two important points which are too high :

  • Tick Time
  • World Tick Time

What is the diference between these two values, why a simple widget component not even visible take so much time to be executed ? Thanks for your help

138624-components.png

Try this: Screenshot - ac3b6a1d452b7949e831ca6a20c12b33 - Gyazo

But in general I would advise you to Add the Widget Component when you need it. There is no point on having them on over 9000 Actors by default. Something simple like that works fine you can also remove it whenever you want. (Note if you click on the Add Component Node you can Set the defaults in the Details Panel)

If you only display 1 Widget at once its better to have it on your Character and move it around in Worldspace and feeding it with Tree Data instead. So you will only have 1 Widget at most in your World (saves Performance ;P)

Nice tried, but your first idea doesn’t changed anything ^^

But the two others seams very good :o
I can’t test right now because I need about 2 hours to compile when I add or remove a widget component ^^’ (and I have a good computer x)
I’ll test tomorrow and will give you a feed back,
Thanks for your idea !

cO you need 2 hours to Compile? Are you rebuilding the Engine Source every time xD? Takes ~1min usually for a small change like that.

Unless you mean Packaging :stuck_out_tongue_winking_eye:

xD Usually the time is very short, but not since I add all these trees
I just click on the Compile button in the Blueprint class and everything freeze, I can’t even back to my desktop during 2 hours x) I still can use my computer but not changing anything on Unreal. Yeah it took me a while to understand that the problem came from my Widget Component ^^

Thank you very much, everything is working fine :smiley: