Billboard GUI issue

Hi, I am using a billboard gui to replicate my angle bar to the characters right arm, but it doesn’t update smoothly.

ScreenGui vs BillboardGui

Angle bar code:

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local Workspace = game:GetService("Workspace")

local Player = Players.LocalPlayer
local CurrentCamera = Workspace.CurrentCamera
local Frame = script.Parent

repeat task.wait() until Player:FindFirstChild("Settings")

local Settings = Player:WaitForChild("Settings")
local AngleBarOffset = Settings:WaitForChild("AngleBarOffset")
local AngleBarMultiplier = Settings:WaitForChild("AngleBarMultiplier")



RunService.RenderStepped:Connect(function()
	local LookVector = CurrentCamera.CFrame.LookVector
	local Angle = (math.asin(LookVector.Y) * AngleBarMultiplier.Value) + AngleBarOffset.Value 

	local Height = math.deg(Angle)

	if Angle > 40 then
		Angle = 40
	elseif Angle < 0 then 
		Angle = 0
	end

	Frame.Height:TweenSize(UDim2.new(1, 0, Angle/40, 0) , "InOut" , "Quad" , .05)
end)

Any help would be appreciated, thanks!

Pretty odd but this could be because of your scaling with the UI or the tween size itself, I dont recommend creating a tween every frame, try if this fixes the problem.

Frame.Height.Size = Udim2.new(1,0,Angle/40,0)
1 Like

Same thing pretty much happens

its probably how the gui is set up, pretty odd. can you send me the pic of the expolorer and the guis properties

image
here is billboardgui

would u mind to send the rbmx file of the ui / code so i can debug it for you, if you dont mind. this doesnt really help much and we’d be going back and forth a lot

here:
make sure to parent it to the script that i have sent above

I have tried using while task.wait(0.1) instead but it still does the same thing, i was wondering if it has anything to do with the currentcamera?

CameraBar.rbxm (11.0 KB)
try this under startergui and be sure to fix the issue with the scaling. the tween and all works but the size isnt 100% I also js realized i created a fake value and that might be the reason

be sure to delete these

local AngleBarOffset = {Value = 4}
local AngleBarMultiplier = {Value = 4}

was js there cuz i needed to test

thanks i will try this out and let you know if it works

sorry, but i tried to scale it, it worked, but when i zoom out, it just disappears

that is due to the scaling of it, you can play around with that or see the official documentation of BillboardGui in roblox to figure that out

change the size of Billboard Gui to ::
{0, 500},{0, 200}

image
yeah it doesnt work, i read the documentation tried experimenting with different sizes and all of them dont work, it disappears when you zoom out

oh! thats the max viewing distance
image
make this inf

already is, doesnt seem to work

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