Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can't move a parts position with tweenservice?

I'm trying to move a character to another characters position with tween service, when I try this script it says 'Unable to Cast to Dictionary'

local Tweener = game:GetService("TweenService")
						local Info = TweenInfo.new(
							1,
							Enum.EasingStyle.Elastic,
							Enum.EasingDirection.Out,
							0,
							false,
							0
						)
						
						local goal = {
							root.CFrame == v.HumanoidRootPart.CFrame;
						}
						
						local combatTween = Tweener:Create(root,Info,goal)

1 answer

✓ Accepted answer

goal isn't a dictionary. You can make it so by replacing root.CFrame on line 12 with CFrame. You're also using comparison =='s, replace the == with just = on line 12.

Goal needs to have every value that's being changed labeled by name, so if you're changing CFrame you'd use {CFrame = value}, if you were changing transparency as well you'd use {CFrame = value, Transparency = value}

Note that the labels are case sensitive, so cframe and Cframe won't work, it must be CFrame.

3 comments

0

You got rid of the errors, but it's not working at all now

0

You're remembering to :Play() the tween right?

0

I'm an absolute idiot, thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.