Tweening a character smoothly

I want to make a smooth effect which tweens the player to the last checkpoint instead of just abruptly teleporting the player back.

Even though it works, it is extremely laggy and choppy, which I believe is due to the delay in the character following its humanoid root part.

I tried searching up the devforum for people who might have experienced something similar but couldn’t really find anything as such. If anyone has any idea of how I can make this smoother using tween or any other method that would work better, please let me know.

Here’s the code that I am currently using:

local TweenService = game:GetService("TweenService")

	if Players:GetPlayerFromCharacter(hit.Parent) then
		local Player = Players:GetPlayerFromCharacter(hit.Parent)
		for i,v in pairs(game.Workspace.Checkpoints:GetChildren())do
			if Player.leaderstats.Stage.Value == v.Value.Value then
				local CFrameTween = TweenService:Create(hit.Parent.HumanoidRootPart,,Enum.EasingStyle.Linear,Enum.EasingDirection.Out,0,false,0),
					{CFrame = v.CFrame +,2.5,0)})

Video of the character tween:

robloxapp-20201227-0326200.wmv (880.4 KB)


You could try anchoring the HumanoidRootPart during the process of the tweening as it would be likely that its physics are interrupting through it.

If you wanna take some measures to make the tweening less choppy, try tweening the RootPart on the client. Any changes on the character that is on the client will be able to replicate on the server.

P.S: Please put ``` from the top to the bottom of the code instead of putting it in a quote. It will make it easier to read your code that way.


It worked! It’s alot smoother now! Thank you so much for your help!

However, I do have a question, I thought that tweening anchored parts didn’t work, how come it’s working now?

Tweening anchored parts does work? Tweening a part’s CFrame doesn’t correlate into physics at all. When you anchor a part, it only stops any possible interaction with its physics. It doesn’t entirely restrict its movement.

1 Like

Tweening isn’t moving per say, it’s more teleporting the part really fast between a lot of close points. It doesn’t actually change the velocity which the anchored property locks.

1 Like

Hmm! It is a lot less rough but strangely enough it still shakes slightly? I tried setting the camera subject to the RootPart since I thought maybe that it was the body parts that were shaking, but it is actually the HumanoidRootPart which is shaking, I also turned of CanCollide. Not to sure why it is still shaking, do you have any idea?

did u find a solution for this ?

Anchor the Humanoid root part of the character