Overlay Collection: Objects not responsive to setting visibility

I am trying to create a HUD with hearts. But when I try to set the hearts to turn invisible, they never do. I’ve tried the Visibility Actuator through Python, the setVisible() module, the setVisibility() module, even bpy.hide_render(), everything under the sun, to no avail. I have even tested setting a floor to invisible and that works, so why can’t an overlay collection do it?

Even scene.objects cannot turn the health objects invisible with the visible and setVisible() modules!

My HUD is set so it comes up whenever the player receives something and the HUD will appear (turn visible) via the Collection Actuator. The HUD will turn invisible after a few seconds via a Timer property through another Collection Actuator.

Please help me, as this is so frustrating!

Use a shader and a attribute,
we can set per face / edge / vertex attributes using py

attributes = kx_object.blenderObject.data.attributes
Attr = attributes["Name“]
Attr.data[index].value = 3

or using ui / in edit mode

Once each heart has a value use attribute at the object domain to compare to, and set alpha using the comparison

KX_object.blenderObject[‘Health’] = 5

Hello, I’ve tried and it works for me, here’s a test file, It is made in UPBGE 0.36.
I don’t call the actuator, instead I use “.visible” directly from the object.

OverlayCollectionVisibility.blend (1.0 MB)

UI_using_vertex.blend (952.5 KB)


this is better drawcall wise

we can even choose what type of object to emit per point / how it behaves in geometry nodes .

When I assign attr.data[propertyname].value I get:

TypeError: bpy_prop_collection[key] = value: invalid, expected a StructRNA type or None, not a int

there is no value here, That is for geometry attributes.

for object attributes

kx_object.blenderObject[‘PropertyName’] = value

For objects that refuse to turn invisible, you can create another object, assign a completely transparent material, and then use an Edit Object → Replace Mesh (GFX) to replace the visible mesh with the invisible one. Make sure to switch it back to the visible one when you want it to.

This is not a good solution, check my video, each object is another draw call, you can draw all of of it for that cost.