Hi developers , I have this kind of issue idk how to solve it, like when a player character standing on the platform the moving part will get shuttering, Here’s my simple code:
local TweenService = game:GetService("TweenService")
local End = script.Parent:WaitForChild("End")
TweenService:Create(script.Parent, TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true), {CFrame = End.CFrame}):Play()
Is the part anchored?
If the part isn’t anchored then the part will be affected by gravity, causing it to be able to be pushed or fall or whatever.
While your tween is running, it will snap it back as soon as it was moved, but it will cause some short stuttering.
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local End = script.Parent:WaitForChild("End")
task.wait(1)
TweenService:Create(script.Parent, TweenInfo.new(5, Enum.EasingStyle.Quad, Enum.EasingDirection.InOut, -1, true), {CFrame = End.CFrame}):Play()
local LastPos = script.Parent.Position
RunService.Stepped:Connect(function(i, DeltaTime)
local actualPos = script.Parent.Position
local delPos = actualPos - LastPos
local vel = delPos/DeltaTime
script.Parent.AssemblyLinearVelocity = vel
LastPos = actualPos
end)
Make sure you’re playing the script on the client side and not server side to:
Optimize and help reduce strain on the server.
Make the movement much smoother as its based on the client’s ability to run it.
If you’d like to do sanity checks/exploit checks, do split checks on the server with inbetweens of seeing if it matches from server to client.
Client handles any effects, movement, visual stuff.
Server handles important events, major functions, and other vital parts that are important to gameplay.