Right, so I have a car which uses body-movers to steer and to move with a few problems.
seat = script.Parent local vehicle = seat.Parent local DriveForce = vehicle.MainComponent.DriveForce local Turn = vehicle.MainComponent.BodyAngularVelocity local speed = 40000 local turnspeed = -1.5 local engineSound = vehicle.EngineSound function getSpeed() return math.pow(math.pow(vehicle.MainComponent.Velocity.X,2) + math.pow(vehicle.MainComponent.Velocity.Z,2),0.5) end while true do wait() DriveForce.Force = seat.CFrame.lookVector * speed * seat.Throttle Turn.AngularVelocity = Vector3.new(0,seat.Steer*turnspeed,0) print(DriveForce.Force.X) print(DriveForce.Force.Y) print(DriveForce.Force.Z) print("------------------") local gearthresh = 40 + (speed*2) local speed = getSpeed() local strain = (speed % 40) if (speed > 40) then strain = strain + 33 end engineSound.Volume = (strain * 0.2) + 1 engineSound.PlaybackSpeed = (strain*0.01) + 1 end
This script is inside the vehicle seat of the car.
It works absolutely fine when you play using Roblox studio's Start or Play buttons, however, when you play the published project, there is a problem.
When you press W (to go forward), your car won't move and appears to be stuck. I've checked the print statements and the force is definitely being applied to the car, but the force won't make the car go forward.
Interestingly, the car can turn perfectly fine.
Can anybody help? I can give more information if you need it.
Thanks!
-There are no error messages
Ok, so it didn't turn out to be a network issue or anything fundamental, but there was too much friction on the wheels. When I set the friction on the wheels to zero, whilst it was far too skiddy, the car could actually gain traction.
Though I bet network ownership did help, as I did set the parts of the car's network owner to the client.