Hey guys, so I have an issue an I am not sure how to fix it.
So I am using Rectangle in order to show health bar under the mesh (linkWithMesh) and that Rectangle has also added control from AdvancedDynamicTexture.CreateFullScreenUI.
And things are fine since it shows the bar, I am setting the offsets like that:
const advancedTexture = AdvancedDynamicTexture.CreateFullscreenUI("ui1");
const offset = 100;
const container = new Rectangle("myrectangle");
container.width = "100px";
container.height = "12px";
container.color = "black";
advancedTexture.addControl(container);
container.linkWithMesh(player);
container.linkOffsetY = offset;
But the moment lets says I will resize the browser window and make it smaller, the mesh is scaled correctly but rectangle stays the same, which means that it ends up being too big and the offset is waaaay to far away from the target.
How can I make it so it scales dynamicaly? and actually respects the resizing?