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:
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
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.