Use tween service instead of a deprecated old class. If you want to use physics though, then use AlignPosition and put an attachment in the HRP and change it to one attachment mode, make the attachment0 the attachment you put in the HRP, then put the targetPosition as the part’s position.
So first thing you do is get the service by going to the top of the script and writing:
TweenService = game:GetService(“TweenService”)
Now, you replace the code with the following
Info = Tween info.New(
–Your tween time in seconds–,
– Enum.EasingStyle.“whatever, test it out” –
– Enum.EasingDirection.in –
– number of times to repeat the tween (1 in your case)
– true/false to determine if the tween returns to normal
after completing the tween
– number of seconds before the tween and in between
each repetition
)
Now that the worst is ot of the way, you follow up the info with:
Tween = TweenService:Create(
– the target of the tween (the character’s
HumanoidRootPart in this case)
Info
{
–the property to tween - follow this format–
Property = final Value
–in your case that should be –
CFrame = Workspace.DragTo.CFrame
}
)
Ok, Here is the more readable version:
So first thing you do is get the service by going to the top of the script and writing:
TweenService = game:GetService(“TweenService”)
now, you follow up with the following code:
Info = TweenInfo.New(
-- Time over which the tween is stretched, in seconds -- 1,
-- The Easing Style of the tween - you can have it bounce, move at constant speed, accellerate ect. An Enum.EasingStyle -- Enum.EasingStyle.Linear
-- The Easing Direction of a tween, an Enum.EasingDirection -- Enum.EasingDirection.In
-- amount of times the tween gets repeated - 1
-- whether the tween undoes itself once reaching the target, a boolean -- False
-- amount of seconds to wait before the tween starts and inbetween tweens -- 0
)
That was the Slightly Harder part. things only get easier:
we now construct the tween with:
TweenService:Create(
-- the target instance that performs the tween -- Character.HumaoidRootPart
-- the Tween's Information, which we detailed above -- Info
{-- The Properties that must be changed, which must be detailed in a table --
-- Property to Change = target result -- CFrame = Workspace.DragTo.CFrame
}
)