Can only tween objects in the workspace

Hello! I am trying to tween a gui and an error pops up saying can only tween objects in the workspace. the object I am trying to tween is in the players playerGui

Please provide a code example so we can assist you.
P.S. GUI objects have their own tweening methods.

FrameName:TweenPosition(UDim2.new(0, 0, 0, 0), Enum.EasingDirection.ReplaceThis, Enum.EasingStyle.ReplaceThis, 1)

this is what it looks like

clone.Frame:TweenPosition(UDim2.new(0,0,0,-40), Enum.EasingDirection.In, Enum.EasingStyle.Bounce, 2.5, false)

The tween works fine for me using the following test setup:

image

LocalScript:

local clone = script.Parent

task.wait(5)

clone.Frame:TweenPosition(UDim2.new(0,0,0,-40), Enum.EasingDirection.In, Enum.EasingStyle.Bounce, 2.5, false)

Have you made sure the script is a LocalScript, and everything is inside PlayerGui or StarterGui? Is the script in a place where it is able to be run, such as within a GUI or within StarterGui/PlayerGui? Is Frame an actual Frame and not a ScreenGui? (You can only tween frames, not screenguis). Is there any other code in the script that could be interfering?

If none of these were your problem, please send an image or copy-paste of the exact error you are getting, and an image of the gui layout as seen from your explorer.

right now its in a script not a localscript ill try that

Hmm. none of those are the problem and I dont know how to take a picture lol. Im going to add a small wait and see what happens

If it’s not in a localscript, that is for sure your issue. Gui elements cannot tween in a server script. You should already be adding a wait somewhere (try using task.wait(7.5) before the tween), because if it just immediately runs you won’t catch the tween before the default loading screen disappears.

To take a screenshot on Windows, open the snipping tool app from the search menu. Click new, and select the area you want to take a screenshot of. Results will be automatically put on your clipboard, so you can use CTRL + V to paste it here.

1 Like

This error means you are trying to Tween something that has no Parent (Meaning the Parent is nil)