[Error]: "Can only tween objects in the Workspace" with UIs

Hey there!

I’m making an egg hatching system and i encountered an issue for the first time!

I’m trying to tween the position of a ViewportFrame (VPF) and here is the code sample:

	--> SetUp VPF and Blur:
	VPF:TweenPosition(UDim2.new(0.5,0,0.5,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, true) -- Time can change
	local blurTweenOn = tweenService:Create(blur, blurTweenInfo, {
		Size = 5 -- Can change
	})
	blurTweenOn:Play()
	blurTweenOn.Completed:Wait()

The error come from the second line:

VPF:TweenPosition(UDim2.new(0.5,0,0.5,0), Enum.EasingDirection.Out, Enum.EasingStyle.Bounce, 1, true) -- Time can change

The output error is:

 14:02:17.681  Can only tween objects in the workspace  -  Client  -  clientEggHatching:58
  14:02:17.681  Stack Begin  -  Studio
  14:02:17.682  Script 'Players.Padrox_x.PlayerScripts.clientEggHatching', Line 58 - function hatchOneEgg  -  Studio  -  clientEggHatching:58
  14:02:17.682  Stack End  -  Studio

What can cause this issue?

I already googled it and I found this post but it doesn’t help enough :confused:

I think I found the error, I’m using a clone of my VPF and I did not parent it. I think the error comes from the fact the VPF doesn’t have a DataModel as a parent. I’ll parent it and I’ll give you a feedback if I solved the problem or not.

My problem on this post have never been solved, i just added a pcall for hide the error becose the error don’t anymore broke the system (this is bad i know)

Yeah! It worked, the eror is fixed! I just had to parent the VPF.

I’m sorry for you Med :confused: