@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?
bumb, im still experiencing this bug, i clone the vehicle from RepStore to a folder in the workspace and then use :Sit() but the player cant controll the vehicle. If the player jumps out of the seat the player cant enter it again by walking over the seat
I think I found a solution that fixed the problem for me. In a local script, I waited for the vehicle to load using ContentProvider:PreloadAsync({VehicleSeat}). After it loads, I fire a RemoteEvent to the server where a server script will call VehicleSeat:Sit(Humanoid). Here is the code:
In my game, I put a RemoteEvent name IsLoaded inside the VehicleSeat. Sometimes it didn’t finish loading the RemoteEvent when I called it so I used WaitForChild to fix that.
to anyone who still relies on vehicleseat, read this
roblox moved away from having “use-case” classes years ago because it goes against game engine design principles
in 2008, we had glue, capture flags, skateboards, vehicleseats, build tools, hinges not made using scripts but hard-coded into the engine as classes Instance.new(“SkateboardPlatform”)
the only supported modern class in this category would be the proximityprompt
but that was added in order to make ClickDetectors redundant because they caused a bad user experience on mobile (you can’t tell what is clickable on mobile with clickdetectors)
in modern roblox, just like in any other game engine, the classes are puzzle pieces that make up something functional when scripted
vehicleseat is the only one of those 2008 examples that isn’t deprecated because of it’s continued use in games, and i don’t expect roblox to continue fixing it, it literally uses deprecated weld objects to attach people to the seat
i think someone made a VehicleSeat2 chassis that is scripted and offers more control, maybe look into it
expect clickdetector and vehicleseat to deprecate eventually
Recreating the problem can be tricky since it rarely happens. It usually occurs when a player joins the game, and it might be connected to high ping or server (client?) lag, but I’m not entirely sure.
There’s also another issue (though I’m not entirely sure if it qualifies as a bug), where occasionally, when a player is automatically seated upon joining, it disrupts the seating animation.
Broken:
How it should look like:
While writing this message, the VehicleSeat didn’t properly seat my humanoid. When this bug occurs, the HUD doesn’t show up, and I cannot drive the ATV but sitting animation is being played. (When this happened there were no errors/warnings in the console at all.)