Im making an elemental game, and i am doing polishing to the gui buttons by using tweenservice to largen the button when clicked. But instead of getting larger, it shrinks into infinity. No matter what i put as size this happens. Here is the code (localscript)
local uis = game:GetService("UserInputService")
local ts = game:GetService("TweenService")
local player = game.Players.LocalPlayer
local btn = game.StarterGui.moves.e
local goal = {}
goal.Size = UDim2.new({0,5, 0},{0.5, 0})
local tweeninfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
That’s not right.
Nowhere in the TweenService documentation entry states that exception, plus, TweenService can be, indeed, used outside of the WorkSpace (take this case for instance, all the times Tweens have been used in GUIs).
Ok, maybe, but I’ve seen lots of people that have gotten this error and even got it myself at one point while trying to tween a GUI. If there’s something I’m missing, then please let me know!
Since the Workspace is being referred as ‘workspace’ in that error (like, not capitalized), I don’t think it’s referring to the proper Workspace Service (game.Workspace/game:GetService("Workspace")), rather it must be referring to the script’s workspace (environment) or something like that.
After some investigation, this guy solved their instance of the issue by not saving their GUI instance to a variable and using that variable, but directly referencing it through an ancestor of it, so most likely it’s the script’s environment:
Hope that helps, but yeah, I agree it’s a weird error (and message), haha.