VehicleSeat Unreliable - Sometimes Doesn't Work

VehicleSeats seem to have an issue where they don’t always work when using VehicleSeat:Sit(humanoid). This does successfully “sit” the character, but the controls don’t seem to be capturing. For instance, the HUD doesn’t show up & trying to steer/throttle the vehicle does nothing.

I haven’t been able to properly reproduce this yet. It always happens in a game server – I haven’t experienced this in Studio yet. And it seems sporadic. I don’t know what triggers it. Sometimes it works, sometimes it doesn’t. There are no logs/errors to show.

Other developers have informed me that they have experienced this issue too. It doesn’t seem to be a new issue. I don’t know how long it’s been an issue.

I have tried to hack my way around this in various ways, such as adding a couple of seconds of delay between spawning the car and sitting the character. Nothing seems to work.

I have been experiencing this at my “truck test” place:
https://www.roblox.com/games/4583890260/Truck-Test


The relevant code on my end is the following. I’ve taken out stuff that doesn’t matter:

-- Server-side script. This is a snippet within the vehicle spawner.

-- Give ownership to the player:
truck.Parent = trucksFolder
truck.PrimaryPart:SetNetworkOwner(player)

-- Create a VehicleSeat:
local seat = Instance.new("VehicleSeat")
seat.CFrame = truck:GetPrimaryPartCFrame() * CFrame.new(0, -3, 0)
seat.Parent = truck.Body

-- Weld seat to truck:
local seatWeld = Instance.new("WeldConstraint")
seatWeld.Part0 = seat
seatWeld.Part1 = truck.PrimaryPart
seatWeld.Parent = seat

-- Sit the humanoid after an arbitrary 0.2 second delay:
wait(0.2)
seat:Sit(humanoid)

TL;DR - Sometimes VehicleSeats don’t properly capture user input (e.g. changing SteerFloat/ThrottleFloat properties), nor show the HUD, thus it seems like a VehicleSeat-related bug. This happens when using VehicleSeat:Sit(humanoid). Sometimes it works, sometimes it doesn’t.

69 Likes

Can confirm this happens! Happened to my game earlier this week. :+1:

7 Likes

This happens a lot in Vehicle Simulator, along with another (Possibly related) bug. We automatically seat the players into a new vehicle if they spawn another car when already in a car. It waits to seat until the seat’s disabled property is set to false (Which signifies the chassis code is loaded all the way). Sometimes the cars won’t move, and if you hop out/hop back in (Funny part is using :Sit() still, server-side), it’ll work.

Also, sometimes the values of throttle float/steer float will ‘stick’, like a sort of tweening. If I alternate between pressing A/D and/or W/S, it takes a second to update the values, or it’ll set to 0 and then switch over, causing lag in steering/undesired behavior.

https://gyazo.com/104c0b8dc66261a81d50c65f80ff260e

16 Likes

This is an annoying bug with my train control system, while the client scripts load correctly. Some of the modules which use .Throttle to detect key inputs do nothing.

3 Likes

I’ve been experiencing this bug in both studio and game servers, and it’s plagued me for quite some time.

I looked through the control modules and might’ve found the cause:

The Humanoid.Seated event doesn’t reliably send the “currentSeatPart” parameter when used on the client, probably because the client hasn’t received info about the VehicleSeat’s existence yet. Since the ControlModule relies on this parameter to tell if the humanoid sat in a VehicleSeat or not, you get your issue. It thinks the humanoid is sitting on nil.

image

This seems to happen far more often when loading vehicles with high part counts. I’ve created a repro for this bug here:
VehicleSeat Bug Repro.rbxl (50.1 KB)

Theoretically, you can work around this bug in your game by waiting until the client has received data about the VehicleSeat before calling Seat:Sit. Alternatively, you could edit the ControlModule to use GetPropertyChangedSignal(‘SeatPart’) instead of Seated to run ControlModule:OnHumanoidSeated.

8 Likes

I’ve had a similar issue for around a year now. I don’t use any code to force the player to sit. I just allow the player to sit via touching the seat.

From what I’ve diagnosed from countless hours trying to debug:

  • Not easily reproducible
  • The seat has changing values but the control script isn’t picking it up for whatever reason.
  • Players with poor connection are more likely to be effected.
  • Only happens to cars using constraints.
  • After various talks with people from the physics team who’ve been working tirelessly on cars, both here on the DevForum in DMs and at RDC, none of them have ever seemed to experience this issue, nor do they have any ideas of what could cause it (no matter how many repros I’m able to provide or video proof of it)

I’m going to be an Accelerator in the Spring and my hope is while I’m there I might be able to get a bit more to the bottom of this while at the HQ. :sweat_smile:

4 Likes

It wouldn’t by any chance have effect on vehicles using hinges, because I use them and my vehicles steering sort of dies out and functions oddly, only sometimes, other than that it works fine. It’s just started today.

1 Like

Been also experiencing this, it happens quite a bit in my game. and also getting reports about being unable to maneuver vehicles.
IIRC the Changed event doesn’t fire for Throttle & Steer when this happens. Awhile ago I spent ages trying to figure out what was wrong because there were no errors to rely on. I thought it was something to do with NetworkOwnership, but in the end I just gave up because I couldn’t find a solution for it.
Relieved to know it isn’t something on my end. It’s annoying to say the least.

2 Likes

This happens quite frequently for me too. I really hope this issue gets fixed.

It happens to me as well, I ride a vehicle and it doesn’t even move.

Can confirm this is still happening. I wish I could give more details, but as previously mentioned, it’s incredibly hard to reliably replicate this bug.

This and multiple other reasons have forced me and others to have to make our own Psuedo seats using a part, value objects to mimic some seat properties and then a weld to keep the character in place. Pros of this method just means a more reliable system if done right and little to none of the lag spiking some others have reported here: Severe Performance Bug triggered easily with sitting down in a Seat with many parts in the place

1 Like

@higbeaad, I am having the same problem and it seems like many others are struggling too.
If you have some time, please elaborate on how to do the solutions you propose. Surely many would appreciate.

Thanks in advance!

1 Like

@micheal999990, sounds like you have a solution to the problem.

Please be so kind and explain the solution in detail so others struggling can move on.

You use a Part instead of he DriveSeat?
Then you modify the car script to instead get the values like Velocity from Value objects, which are children of the Part and then you teleport the player to the Part and weld him?
:thinking:
Doesn’t the DriveSeat provide a bunch of other functionality?

Please help!
Thanks in advance!

So when you make a Psuedo seat for example where you teleport the player to a part you can then use value object’s or local variables to replace stuff like occupant, the humanoid property of seatpart etc. For example most common thing on my planes is checking seat is Occupied and by the right whitelisted person via Occupant property, making sure I can disable seating in the seat. These can easily be replaced by having in my case an Object Value property which is called Occupant and just updates its value to the Humanoid of the player currently seated. A Disabled named Bool Value object would then be used to toggle on and off the ability to sit in the seat when the player clicks or presses E to sit etc.

1 Like

This issue has still not been addressed and has become a major bug bare for my current project. Not just does it sometimes fail to capture the input sometimes it:

  1. welds player to seat without controls or jumping.
  2. Fails to seat the player.

They’re unreliable all around but the biggest issue is simply not capturing the controls.

This just came up for us again when testing something out that uses VehicleSeats

This is printing the active and currentSeatPart values. You can see that it is printing active as true but there is no seat part.

Wrote a workaround within ControlModule. If active is true currentSeat part doesn’t exist, I wait for it to be available. This seems to fix all issues we experience with VehicleSeats.

5 Likes

Hello. Sorry for the delay in response. This issue is being worked on and we’ll follow up when we have an update for you.

8 Likes

I’ve noticed that even :Sit() has become unreliable in successfully sitting the player; Maybe to patch the bug mentioned here as a failsafe? Either way, this should be high priority and yet somehow not fixed?

2 Likes

The Sit method only appears to be 100% reliable when called on the server. We just have a remote event that can be fired for any seat in game.