Are you getting any errors?
No, however it seems to just keep me in the same position.
It would be nice if you posted your code in a code block. Formatting your code makes it easier for anyone to read your code and potentially help you with your problem.
Format a code block like so:
```lua
-- Your code here
```
Thatāll become
-- Your code here
Fixed, thanks for the tip, never new that it excised.
I tried this method. It does, indeed move my character. But not as intended, as you can see here.
Yeah exactly what im having issues with.
Switched it to server, it keeps ur character in the same position, and once you walk it moves it back.
Iām confused. Is this done on the client or server?
Both for replicating others
Client for preserving velocity to stay on the train
So your client is setting your character as fast as possible.
How about other clientās characters? How are they setted?
See what I donāt get, I canāt use CFrame on local scripts.
2 Months later and we still donāt have the answerā¦
Yep, i have no idea on what to do differently.
This is what I do and my version works pretty well.
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()
--------------------------------------------------------------- CHECK PLATFORM BELOW
local RootPart = player.Character.LowerTorso
local Ignore = player.Character
local ray = Ray.new(RootPart.CFrame.p,Vector3.new(0,-50,0))
local Hit, Position, Normal, Material = workspace:FindPartOnRay(ray,Ignore)
if Hit and Hit.Name == "RaftTop" then -- Change "RaftTop" to whatever the moving part's name is
--------------------------------------------------------------- MOVE PLAYER TO NEW POSITON FROM OLD POSITION
local Train = Hit
if LastTrainCFrame == nil then -- If no LastTrainCFrame exists, make one!
LastTrainCFrame = Train.CFrame -- This is updated later.
end
local TrainCF = Train.CFrame
local Rel = TrainCF * LastTrainCFrame:inverse()
LastTrainCFrame = Train.CFrame -- Updated here.
RootPart.CFrame = Rel * RootPart.CFrame -- Set the player's CFrame
--print("set")
else
LastTrainCFrame = nil -- Clear the value when the player gets off.
end
Function2 = player.Character.Humanoid.Died:Connect(function()
Function:Disconnect() -- Stop memory leaks
Function2:Disconnect() -- Stop memory leaks
end)
end)
In my case, āRaftTopā is the bright, large plank of wood on top of the raft. Slightly hard to see in the video but the player does turn with the platform. The player can jump on while itās moving and move with it, it works just as the Jailbreak trains do. Also yes, I was testing a raft with no water. I know it looks ugly.
Hope I could help! Feel free to ask any other questions if you need extra help or if something doesnāt work.
Wow. Thank you so much, this thread has gone unnoticed for such a long time and i lost all hopes. Ill be sure to give you credit whenever i use this.
No problem! Iām glad I could help!
Whats funny is that I was literally just looking for this and you posted a solution 40 mins ago lmao
Thanks my dude https://gyazo.com/a7ce4055d9cc3305451c77a15651b76d
Do you have any idea why it doesnāt work for body movers? I seem to get pulled around a lot for some reason and then I get flung off when the plane moves fast https://gyazo.com/3590beb2155a8d7271a4ad77d2ab4e52
Iāve never tried it with body movers so Iām not sure. My only idea is that something could be conflicting with it, because as long as the part is not anchored or welded to another anchored part Roblox tries to keep the player on it themselves.
Yeah I realised that. My current plan is to make a āfakeā part that gets put to the position of the floor every second, and then Ill use that for the platform.