Elevator jitters when going up

Hi, I made an elevator with tween service but it jitters also sometimes elevator doesn’t collide and you can fall down. I searched about 4 hours but I couldn’t find a good solution to my issue. I need help. Thanks…

My code:

local rs = game:GetService("ReplicatedStorage")
local ts = game:GetService('TweenService')
local elevator = script.Parent
local elevatorsModel = elevator.Elevators
local elevatorPart = rs:WaitForChild("ElevatorPart")
local elevatorSpawnPoint = elevator.ElevatorSpawnPoint.Position
local elevatorDestroyPoint = elevator.ElevatorDestroyPoint
local elevatorSpawnInterval = 4
local reachSeconds = 60
local reachPosition = elevatorDestroyPoint.Position

local tweenInfo = TweenInfo.new(
	reachSeconds,           
	Enum.EasingStyle.Linear  ,
	Enum.EasingDirection.InOut,
	0,
	false,
	0
)

while wait(elevatorSpawnInterval) do
	local obj = elevatorPart:Clone()
	obj.Position = elevatorSpawnPoint
	obj.Parent = elevatorsModel
	local tw = ts:Create(obj,tweenInfo,{Position = reachPosition})
	tw:Play()
	tw.Completed:Connect(function()
		obj:Destroy()
	end)
end

Perhaps in your loop, change it to this?

while wait(elevatorSpawnInterval) do
	local obj = elevatorPart:Clone()
	obj.Position = elevatorSpawnPoint
	obj.Parent = elevatorsModel
	local tw = ts:Create(obj,tweenInfo,{Position = reachPosition})
	tw:Play()
	tw.Completed:Wait()
	obj:Destroy()
end

Instead of connecting an event to the Completed Signal that is obtained when the tween is completed, wait for the Tween to finish and then destroy it

I don’t know if this will even do anything, it could be something related to tween itself

Thanks for the answer but it’s not solving the problem.

What is the issue that you’re having exactly, could you send a video of it happening

https://streamable.com/tx3o7g the elevator jitters.(I uploaded to an external website because devforum doesn’t let me to upload it says an error occurred.)

Maybe try changing the EasingStyle you’re using to see which would help out, perhaps try Enum.EasingStyle.Sine. Again, I’m not sure if it’s due to the part itself jittering or if it’s due to the game having to move the player up after moving the part which makes it look like a jitter

1 Like

I think the problem is Roblox’s awful physics engine. And unfortunately changing easing style is not works.

Then I believe it’s due to something out of your control, although it could be that my knowledge is limited and I dont know if there’s a solution to this. But every game I see that has something that elevates suffer this issue

Okay, thanks for your help. I will search more and if I solve the issue I will post the answer here.

1 Like

I had good luck with a platform elevator in my game using animation and making the elevator
a “humanoid”.
(70) Elevator Platform - Roblox

1 Like

It’s a good idea, but the model is not working.

So in game it works. Not sure why the link is not.
https://www.roblox.com/games/5580633559/Fun-Mountain?refPageId=5fa07238-0c4e-44d6-b78a-690af0820d14

Are you doing it on the server or client? Server tweens sometimes jitter.

1 Like

Exactly; I believe the server replication to the client is a bit slow, and so the jittering happens. Perhaps use the server for physics but use the client for visuals? I’d attempt to make it more client-sided than server-sided, so that there’s no replication lag.

If it is a replication problem, then the more players on the server, the more jittery it will get.

Take it lightly, just an idea.

Edit: Perhaps Network Ownership may help?

Hey everyone, I solved the problem with RayAnimate. The jittering problem %99 solved. Thank you all! Here is the tutorial video: DevForumElevator.mp4 - Google Drive

1 Like