I'm working on a few projects that rely on players standing on tweening parts, and the idea is that the players move with the part.

I have done my research on the topic and founds a post about the JailBreak method. This works, but there is still a noticeable shutter.

I was wondering if there was any way to basically bind local code(might have to move to server-side, which is fine) to happen after every frame of a server-side tween.

Local Code:

-- Bare bones for testing
local RunService = game:GetService("RunService")

wait(5)
local LastElevatorCF = CFrame.new()

RunService.Heartbeat:Connect(function()
	local ElevatorCF = game.Workspace.ElevatorBase.CFrame
	local Rel = ElevatorCF * LastElevatorCF:Inverse()
	game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = Rel * game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame
	LastElevatorCF = ElevatorCF
end)

Server Code:

-- Again, very minimal for proof of concept
local TweenService = game:GetService("TweenService")

local NewTweenInfo = TweenInfo.new(5)

local TweenUp = TweenService:Create(script.Parent, NewTweenInfo, {Position = Vector3.new(0,20.5,50)})
local TweenDown = TweenService:Create(script.Parent, NewTweenInfo, {Position = Vector3.new(0,.5,0)})

while wait(5) do
	TweenUp:Play()
	wait(5)
	TweenDown:Play()
end

Thanks in advance, ThatDevTim

2 comments

0

I think i found something, if the tweens are local, all of the shake is gone(because all local scripts have the same "frame rate"))

0

If I apply this logic to the server i think i figured it out