VehicleSeat Unreliable - Sometimes Doesn't Work

This still seems to happen, even when using the :Sit method

2 Likes

Can confirm this happening, even after waiting 5 seconds and calling from the server.

1 Like

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

7 Likes

Anyone who is experiencing this issue, please respond with where you saw the issue and how to reproduce it thanks.

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)
1 Like

This is an ongoing issue. To reproduce this:

  1. Parent vehicle to ReplicatedStorage

  2. Parent vehicle to Workspace via Script while simultaneously using :Sit() on the VehicleSeat and player’s humanoid.

  3. After being seated, you will notice that all controls are lost.

1 Like

As I alluded to, the issue is not obtaining NetworkOwnership correctly.

In your case, add a workspace:WaitForChild(car) to your code that’s parenting the car to workspace and then call for the Sit function.

Notably, your instructions only reproduce the issue sometimes. Only users suffering from lag would get an “everytime this happens” result.

Setting the network ownership did not fix the issue, I just tested this.

I am on Windows 11, if that helps.

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

Can confirm, it would glitch even if everything is replicated in workspace, and even if it’s a VehicleSeat sitting on the ground, it’s broken

That’s a different bug you’re talking about. Keep oscillation bug issues to the oscillation bug thread.

That is a different bug compared to the one on this thread. Post about that bug here: VehicleSeat Throttle/Steer oscillation on single tap of an input key during frame lag

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.

1 Like

Hey everyone!

A fix for this was just released. Please update this thread if anyone continues to see this issue.

Thanks!

2 Likes

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.

2 Likes

Hey, the change was reverted.

Can you send me the place that broke?

Thanks!

1 Like

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?

Yes, please send the places you experienced this issue.

Thanks!

1 Like

Just a heads up I’m still experiencing this issue and there is no fix in place (atleast for me)

3 Likes

I am still experiencing this issue as well.

2 Likes