Thanks so much. Really helped me out. I noticed that if there is something blocking the ray from hitting the “RaftTop” it won’t move you.
Here is what I did to stop that.
--Replace Ignore with this.
local Whitelist = {} -- Table of Every "RaftTop" (You could just make a model or folder for it.)
local ray = Ray.new(RootPart.CFrame.p,Vector3.new(0,-50,0))
local Hit, Position, Normal, Material = workspace:FindPartOnRayWithWhitelist(ray,Whitelist)
Hello there! I have been struggling to get this script working properly. I have been testing this out on a boat witch contains of some models not a part. I have not figured out how to get it working and I had been glad to get some help with my problem, since i am not a professional scripter. Every little help works!
When I did the improvement. was the game sending many error messages and didn’t stop. The “player” error was a nil value, and when I replaced the variable with “player” it didn’t work.
I was able to get the client to stand/move on a platform smoothly, but I’m having difficulty replicating other clients positions without them lagging behind and stuttering.
I think this is a problem with humanoid replication, as i renmeber before the new “walking on moving platforms” came out with the replication fix, users would allways lag behind the platform.
Does anybody have any ideas on how to stop the jitter of other players? Only the localplayer looks stable, everybody else thats on the platform is all over the place
I already saw that, I implemented it and it still happens all it does it decrease the amount of jittering but its still very noticeable, I went to jailbreak to see how their system is working and they are having the same issue, other players on the train jitter a little bit as well.
This is a pretty bad an inefficient way of replicating changes - make it so the client is entirely responsible for their own rotation and trust that, as they have network ownership of their parts - you’ll never keep up entirely if you do it from the server down.
Hey, sorry for necroposting but I feel like this is the best time to do this.
So I’ve got this issue with your script because I have a plane model that has multiple parts. However, the plane model doesn’t have one static part (RaftPart) so it’s teleporting me around like crazy.
local Players = game:GetService("Players")
local player = game.Players.LocalPlayer
local RunService = game:GetService('RunService')
local LastTrainCFrame
local Function
local Function2
Function = RunService.Heartbeat:Connect(function()
local RootPart = player.Character.HumanoidRootPart
local Ignore = player.Character
local ray = Ray.new(RootPart.CFrame.p, Vector3.new(0,-500,0))
local Hit, Position, Normal, Material = workspace:FindPartOnRay(ray,Ignore)
if Hit and Hit:IsDescendantOf(workspace.Planes) then
local Train = Hit
if not LastTrainCFrame then
LastTrainCFrame = Train.CFrame
end
local TrainCF = Train.CFrame
local Rel = TrainCF * LastTrainCFrame:inverse()
LastTrainCFrame = Train.CFrame
RootPart.CFrame = Rel * RootPart.CFrame
else
LastTrainCFrame = nil
end
if not Function2 then
Function2 = player.Character.Humanoid.Died:Connect(function()
Function:Disconnect()
Function2:Disconnect()
end)
end
end)
Any idea on how to fix this? (btw it’s late for me so i will be going to bed after posting this)