I created a steam locomotive with hinge and rod constraints.
The locomotive can change the value of Vectorforce and adjust the speed by Script.
When I run 7 locomotives, the lag is so bad that it doesn’t show up properly.
When you sit on the locomotive Vehicle seat, only that train will move at normal speed.
In my opinion, the other trains seem to be controlled on the server side, but how can I control this on the client?
Should I use LocalScript instead of Script?
The lag is terrible because it is processed server, so it is slow, so use BasePart:SetNetworkOwner to process the part locally, but be careful as leaving everything to local will slow down the local side.
Thank you for your polite Japanese reply.
I will try what you have taught me.
Another question is, are there too many 3100 movable joints?
I don’t know which one is the limit, but I’m curious because there are other people who are making steam locomotives using physics.
sorry.
It seemed to work, but the behavior is still jerky.
I wrote the following script with reference to this URL and put it in ServerScriptService. Is this enough?
local pathtomodel = --列車へのパス
local pathtoplayer = --プレイヤーインスタンス
for _,part in pairs(pathromodel:GetDescendants()) do
part:SetNetworkOwner(pathtoplayer)
end
I don’t like using local. Hackers can greatly increase the speed of the train. I think you should decrease the number of parts. Sorry for any mistakes in my Japanese!
local pathtomodel = --列車へのパス
local pathtoplayer = --プレイヤーインスタンス
for _,part in pairs(pathromodel:GetDescendants()) do
if part:IsA("BasePart") then
part:SetNetworkOwner(pathtoplayer)
end
end
Of course I read it. Thanks for the advice.
However, I really want to run a locomotive in physics, so I am asking questions knowing that it is impossible.