Been experiencing this issue too, please fix this its super annoying
Edit, think I fixed it, bit different to the code above but seems to work, hopefully I didn’t break anything else
I made this report over 2 years ago now. Nothing has changed. I would recommend custom implementations of a vehicle seat for anyone else that is left struggling with this issue.
Easiest way is to just listen to changes to the Occupant property of the seat and enable/disable controls based on that. You of course will have to write your own code to figure out what the SteerFloat and ThrottleFloat values should be, and make sure to include all control interfaces compatible with your game (e.g. keyboard, gamepad, touch).
Finally! I am not at my computer right now, so I will send code tomorrow, but the way it happens for me is I spawn the car, then use the player sit function, it will sit the player but not let you drive, the module will not respond, and there is no speedometer. This happens 0.05% of the time, so it is hard to reproduce. It is like the vehicle seat just decides to give up.
@NoUniqueAddress
I finally, recently, figured out the issue here. It has to do with the player connecting to the seat but not receiving network ownership.
My reasoning behind this is that:
If you set the network owner of the vehicleseat to the player occupying it about a second after they get in the vehicle, this issue will not appear. I tended to find in the past that this issue typically happened to folks with poor connections more often than those with good connections, if that might also help narrow things down. Notably, it seems VehicleSeats are really finnicky with lag.
@MRKYLO20 Your issue [since I know your game RoStock Racing] is likely stemming from the fact you guys are using “Non-Vision Lag” scripts, where you’re setting the networkowner of the car to Nil [aka the server]. You’re likely doing this too fast after the player gets in the seat, so you’re severing the connection before it’s fully formed. Here’s a more improved version of that script I’m sure you guys are using.
local seat = script.Parent
local Players = game:GetService("Players")
seat.Changed:Connect(function(prop)
if prop == "Occupant" then
local humanoid = seat.Occupant
local player = game:GetService("Players"):GetPlayerFromCharacter(humanoid.Parent)
seat:SetNetworkOwner(player) -- set network owner to the player FIRST to make sure the connection is made instead of hoping the automatic connection takes hold
wait(.5) -- added wait to make sure the connection is made
seat:SetNetworkOwner(nil)
end
end)
I can reproduce this consistently by basically spamming A and D, I am on Windows 11. Here is me using the on-screen keyboard only (no physical keyboard used) and the seat steer (and maybe throttle, untested) alternates between 0 and 1 or -1
This thread you’re posting on has to do with the seat becoming disconnected after getting into it and thus not accepting input. The bug you’re talking about is the oscillation bug. Two separate bugs, two separate threads.
The setting of network ownership fixes the disconnection bug, not the oscillation bug.
hey, uh, did this fix happen to break sitting entirely?
i would post a bug report on this but i can’t because no one can be upgraded to regular anymore.
anyway, seats and scripts that force the player to sit no longer work. players just… can’t sit. it doesn’t happen.
this appears to have fixed it!
this occurred on multiple places, as multiple users were experiencing the issue, so it appears it was site-wide. do you still want me to dm you the place where i first encountered this bug?