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)
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.
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
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}