Billboards continue to update and render whilst out of range

I noticed that my game had some lag spikes when the player rotated their camera or walked around. After checking micro profilier and doing some google searches, I found that the issue related to BillboardGuis. All of my billboards have a MaxDistance set between 50 and 250 yet TextScaling etc continue to update even though I am not within range and can’t actually see the billboard… My game has upwards of 20 zones, each zone has around 10-15 Billboards overtime this issue has become more and more noticeable.

This is extremely easy to replicate with around 300+ billboards and 2 or 3 TextLabels with TextScaled on. You’ll notice that even when you’re out of range and rotate your camera, you will begin to get some lag spikes as shown below:

Backup Video incase the one above doesn’t work: https://youtu.be/H-W29LYBgWQ

This does not apply to when the BillboardGuis are set to Enabled = false. So a simple work around is to check your distance manually and enable/disable the Billboard etc. I will be doing something similar to this for the meantime.

I set up a studio example with around 1250 Billboards. I attached that file to the private content section.

Expected behavior

I would expect the billboards to stop updating and stop rendering when they’re out of range like they do when they’re disabled. This would improve performance extremely for games using a lot of Billboards across a large map.

A private message is associated with this bug report

5 Likes

Thanks for the report! We’ll follow up when there’s any update on the issue.

Hi, thanks for reporting this issue!

I put up a fix where if a BillboardGui is offscreen, it shouldn’t be rendered or do UI layout. However, this check is only enabled if BillboardGui.ClipsDescendants=true. This is because a BillboardGui with ClipsDescendants=false could have contents that might possibly be onscreen, even if the BillboardGui’s canvas area is offscreen.

In the testplace you attached, I set ClipsDescendants=true and MaxDistance=125 for all BillboardGuis, and I didn’t see any spikes in UpdateUILayouts in the profiler when rotating the camera.

If you have a chance, would you be able to check if this fix resolves the lagging/performance spike issue you were seeing? Thanks!

2 Likes