Billboard gui visual glitch help

Well, basically, I’m working on a rendering system for billboard GUIs based on the character’s distance, and I’m having a visual issue with the billboards. When the billboard is Enabled, it causes a slight visual glitch.

image

Code:

RunService.RenderStepped:Connect(function()
	for Index, Billboard in Billboards do
		if not Billboard:GetAttribute("Enabled") then continue end
		
		local BillboardAdornee = if not Billboard.Parent:IsA("BasePart") then Billboard.Adornee else Billboard.Parent
		
		if (Character.HumanoidRootPart.Position - BillboardAdornee.Position).Magnitude <= Billboard:GetAttribute("MaxDistance") then
			Billboard.Enabled = true
		else
			Billboard.Enabled = false
		end
	end
end)
1 Like

Try using the built in MaxDistance property instead of enabled and disabling it. It probably does some backend redrawing every time it is enabled.

3 Likes

Thank you, it was very helpful!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.