DOM position is not correct after update

I have DOM comic ballon that appears above the player or some other game object.
When dom object is visible and you change text inside position is okay and working fine.

But when you hide visibility, then turn on again visible and update the text that will also change the size of DOM object, its position is off, it is not correct.
I tried to use updateSize() but nothing happens.

This is the sample of what im talking about, when you run it and press F, dom will become visible but his position is not where should be.

It’s because the game object can’t resize correctly while it’s hidden. I think you can work around with

comic.node.style.visibility = 'hidden';
// …
comic.node.style.visibility = 'visible';
1 Like

Thank you that was also the only solution that I also come to my mind. It is working like a charm. There is only a problem because now that popup even when visibility is hidden blocks pointerevents because it is always above the NPC hidden, but I will come up with something eventually to solve that.

Thank you!.