Okay, this is kind of hard to explain, so I’ll show a video of what’s happening below.
The player gets moved into the sky, however the HumanoidRootPart, which is the only part that is being tweened. You can see this from the camera, I’m not sure where to go from here. I’m using a RemoteEvent for the tween to make it smooth though.
Here’s the normal serverscript:
function move(h)
local humanoid = h.Parent:FindFirstChild("Humanoid")
if humanoid then
local torso = h.Parent.HumanoidRootPart
game:GetService("ReplicatedStorage").TweenPlayer:FireAllClients(h, script)
end
end
script.Parent.Touched:Connect(move)
Here’s the localscript:
function move(h, scriptReceive)
local humanoid = h.Parent:FindFirstChild("Humanoid")
if humanoid then
local torso = h.Parent.HumanoidRootPart
local ts = game:GetService("TweenService")
local tween = ts:Create(torso, TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out, 0, false, 0), {Position = scriptReceive.Parent.Parent.Destination.Position})
tween:Play()
end
end
game:GetService("ReplicatedStorage").TweenPlayer.OnClientEvent:Connect(move)
If you try to set the rootpart’s position in a regular manner like e.g. RootPart.Position = Vector3.new() then it’ll break the joints connected to it and cause the character to die. This would not happen if you set the CFrame instead.
I don’t know why the joints didn’t break with tweenservice, but I knew it wouldn’t work in a normal matter so it was a guess really. Though, I’m glad it worked out for ya.