Is there a way to make a BillboardGui transparent without recursion?

I am making my own custom health bars for my game using a BillboardGui above each character’s head.

I would like to scale the transparency as the camera moves out.

Is there a way to do this without recursing through all my child gui components and setting the transparency of those?

I think BillboardGui should have a top level Transparency property.

1 Like

There’s no implementation of a global gui transparency property to date, unfortunately.

Your best bet is to bind a GetSignalChangedProperty() listener so that child gui components will reflect the top parent’s transparency changes.

You could also cache a recursion result, but there’s no way to avoid recursing through your components in general.

Would using GetDescendants() on the BillboardGui work? If I’m thinking about this correctly this would allow you to iterate through all the components with a single for loop.

1 Like

He’s asking if you can do this without it

GetDescendants() uses recursion.

1 Like

Ah, I didn’t realise that; noted.