Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

"Can only tween objects in the workspace" Error when in BillboardGui?

Asked by 5 years ago

I'm trying to tween a TextLabel that is in a BillBoardGui. As I try to do this I recieve the error message "Can only tween objects in the workspace". How do I fix this?

local Health = script.Parent.Health
local GUI = script.Parent.TouchBox.Health 

Health.Changed:Connect(function()
    local Hgui = GUI:Clone()
    Hgui.Enabled = true
    local HP = Hgui.Frame.HP
    HP.Text = "HP at "..Health.Value.."%"
    HP:TweenPosition(UDim2.new(0,50,0),2)
    HP:TweenSize(UDim2.new(0,100,25),2)
    wait(2.1)
    Hgui:Destroy()
end)
0
Hgui has to be a descendant of workspace so parent it first hellmatic 1523 — 5y

Answer this question