The gui control which linked mesh flashes and jumps when show,why?

the control link to the cube, flashes and jumps when show,why?

// cube click code
var rect1 = new Rectangle();
rect1.width = 0.2;
rect1.height = "40px";
rect1.cornerRadius = 20;
rect1.color = "Orange";
rect1.thickness = 4;
rect1.background = "green";
advancedTexture .addControl(rect1);

var label = new TextBlock();
label.text = "Sphere";
rect1.addControl(label);

rect1.linkWithMesh(cube);
rect1.linkOffsetY = -50;

flash

1 Like

Hey! do you mind sharing a repro in a PG?

3 Likes

“PG” here means Playground. To create a repro, go to playground.babylonjs.com, recreate the bug inside the playground, then hit the save button and share the link with us :slight_smile:

PS: Welcome to the Babylon community!

1 Like

Hey there, I was really curious why this code wouldn’t work and I went ahead and made a quick playground that runs your code when the box mesh is clicked and it seems to be working. You can see below that I used an ActionManager to respond to clicks on the mesh. :slightly_smiling_face: :beers:
https://playground.babylonjs.com/#6HUMYI

EDIT: I tried this playground repo out on version 4.2 and it does produce the flickering behavior, so I suppose it’s been fixed already. I recommend to try using the latest preview build and see if it fixes the issue for you. :slightly_smiling_face:

1 Like

Yes this was a bug in 4.2 which was fixed in this PR:

Like Blake has suggested, make sure you are on the latest version 5.0 preview. If there are still issues of this please let me know with a repro and I will definitely take a look!

1 Like

I change to the latest version 5.0 preview , the issue does not exist,thank you!

3 Likes

thank you!

2 Likes