My car has a suspension script. Yeah, Alright, here’s the script:
script.Parent.Anchored = true
local function SetupWheel(Wheel:MeshPart)
if Wheel then
local Pos = Wheel.Position - script.Parent.Position
Wheel.CanCollide = false
game["Run Service"].PreSimulation:Connect(function()
Wheel.Anchored = true
local ray = workspace:Raycast(script.Parent.Position, Vector3.new(0, -1, 0) * 50)
if ray and ray.Distance then
Wheel.Position = script.Parent.Position + Pos
if ray.Distance < 5 then
Wheel.Position = Wheel.Position + Vector3.new(0, 5 - ray.Distance, 0)
end
end
end)
end
end
for i, obj in pairs(script.Parent.Parent.Wheels:GetChildren()) do
SetupWheel(obj)
end
script.Parent.Anchored = false
game["Run Service"].PreSimulation:Connect(function()
local ray = workspace:Raycast(script.Parent.Position, Vector3.new(0, -1, 0) * 50)
if ray and ray.Distance then
script.Parent.AssemblyLinearVelocity = Vector3.new(script.Parent.AssemblyLinearVelocity.X, 6 - ray.Distance, script.Parent.AssemblyLinearVelocity.Z)
end
end)
game.ReplicatedStorage.SendMovement.OnServerEvent:Connect(function(Player, A, D)
script.Parent.AssemblyLinearVelocity = Vector3.new((D - A) * script.Parent.Parent.Speed.Value, script.Parent.AssemblyLinearVelocity.Y, script.Parent.AssemblyLinearVelocity.Z)
end)
local BP = Instance.new("BodyPosition")
BP.Position = script.Parent.Position
BP.Parent = script.Parent
BP.MaxForce = Vector3.new(0, 0, math.huge)
BP.D = 1200
BP.P = 50000000
anyway, to get to the point, here is my car:
and here is it moving forwards:
as you can see, it guesses where it will go next. How can I fix this?
Design the frame with the wheels and get that all working. Then make the car parts all welded together. After that, just weld the car to the frame with the wheels.
The thing is, I do not think I can use welds. Please help me out if you actually work on the devforum, or just give me an unfinished and bad solution, and give up like you did.
I don’t work for Roblox or this forum, sadly. I took a shot at a maybe fix. I don’t have your set up and can’t do much more than take a guess. I’m sure someone knows more about this than me…
“I’ve never seen just moving the wheels like that.”
lol, tact just isn’t you’re stong suit is it? I think I’m done… I actually want to help you but,
I’m not going to reinforce the idea that it’s okay to act like this towards others. Good luck…
You should delete this thread and start over with a better attitude.
Maybe someone else will help you out.
I will try to be kinder if you were to actually help out, but all you are doing is telling me non-related topics. So stop.
I have a reason I do it this way, so just please follow along instead of go wandering off.
I can see what you’re doing. I suggest sticking to the client as much as possibe with this.
The server clinet combo will have problems keeping up. Also the body is only one part, so ya no need to weld it together. Be nice if that could be attached to the wheels however. That would be lagless.
The reason I do not attach it is because it needs easy to edit, custom suspension. I want this to be highly configurable, as I am going to have a ton of vehicles.