The other upgrade issue (may actually be a 3.2 or 3.3 change, not 4.0)

Change the alpha of the box (2nd argument of the ‘get overlay texture’ function on line 74) to see it in action. Basically, it seems that something changed between 3.1.1 and 3.3 about how Alpha is inherited down a control chain.

https://www.babylonjs-playground.com/#93JIC9

In a 3.1.1 project, you can have the alpha of the overlay box be 0 and add nonzero-alpha things on top of it and they’ll show up. This is useful so that you can pin things (in this case, target pips) to objects in the scene. It seems that the behavior of alpha changed. To make pips/healthbars/etc visible, I assume the fix would be “don’t use an invisible box as your container” but I’m not sure what would make a better container?

Can you post an image of what you are trying to achieve?

Sure!
overlay_example

See the three pips around the ship on the right? That’s what I’m going for (and works in 3.1.1.) That sort of thing. The pips (or healthbars, or whatever) use a container that is .linkWithMesh()'d to the thing they’re following. I used a rectangle with alpha = 0 for the container, but I don’t think that’s the right move in 3.3+

You can link your pip directly to the mesh (https://www.babylonjs-playground.com/#93JIC9#1)
Might need to play around with some of the settings to get it positioned how you want though.

If you actually still want the rectangle approach, set the rectangle color and background to be ‘#0000’ (https://www.babylonjs-playground.com/#93JIC9#2) Which just sets the color to have an alpha of 0.

You are correct when saying child controls inherit the parent alpha values however. Let me know if these don’t work out for you.

I’ll stick to the invisible box approach which (with your transparent color approach) works! Thanks a bunch!