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.
pullman45
(pullman45)
May 31, 2020, 10:45pm
#3
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
blokav
(blokav)
May 31, 2020, 10:47pm
#5
GetDescendants() uses recursion.
1 Like
pullman45
(pullman45)
May 31, 2020, 10:48pm
#6
Ah, I didn’t realise that; noted.