I have an issue with almost every script in my game where if I have high ping everything lags from vehicle steering to GUI.
How would I go about fixing that.
I was trying to find solutions here but didn’t find any good answers. When I switched WiFi networks and my ping went from 350 to 120 it showed a major difference in responsiveness. I’d also like to mention it runs smooth in studio solo test.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Here is the vehicle script.
local RunService = game:GetService("RunService")
--// FaultyScript 03/26/2020
local Settings = {
MotorMaxSpeed = 10;
MotorA = 10;
SteeringAngle = 20;
SteeringSpeed = 2;
}
--Setup
for _, v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Model" then
v.Motor.HingeConstraint.MotorMaxAcceleration = Settings.MotorA
end
if v:FindFirstChild("Turn") then
v.Turn.HingeConstraint.AngularSpeed = Settings.SteeringSpeed
end
end
--Drive
RunService.Heartbeat:Connect(function(step)
for _, v in pairs(script.Parent:GetChildren()) do
if v.ClassName == "Model" then
v.Motor.HingeConstraint.AngularVelocity = Settings.MotorMaxSpeed * script.Parent.VehicleSeat.Throttle
end
if v:FindFirstChild("Turn") then
v.Turn.HingeConstraint.TargetAngle = Settings.SteeringAngle * script.Parent.VehicleSeat.Steer
end
end
end)
If anyone knows what I should do I would like the help.