Error with code? (TweenService)

So I ran some code that should move a door, and I got this error.

TweenService:Create property named 'CFrame' cannot be tweened due to type mismatch (property is a 'CoordinateFrame', but given type is 'Instance') 

Code:

				local door = workspace:FindFirstChild('Menu'):FindFirstChild('Door')
				
				local moveTo = door:FindFirstChild('DoorSlideTo')
				
				local OGDoorFrame = door.CFrame
				
				local anim = nil
				
				
				-- do tween
				
				local tweenService = game:GetService('TweenService')
				
				local goal = {}
				goal.CFrame = moveTo

				local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.In,0,false,0.01)
				local tween = tweenService:Create(door,tweenInfo,goal)

				tween:Play()

The error explains what’s happening; you’re assigning an Instance to a CFrame value

2 Likes

I didn’t notice that I forgot to add the moveTo.CFrame
Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.