At first, when the bug occurred to me, I thought it had to do with the custom chassis bugging out that I had worked on. However, I went into a different game, and multiple others complained they were suffering the same issue in cars that simply use a vehicleseat, 4 spheres as tires, & hinges (surface hinges).
I noticed the bug happening to me when I got into the 2nd car of the server. (I had a driven a car, got out, and got into a new one, and suddenly was stuck going reverse. When I left the car and got in a new one, this problem continued to plague me.) Other users however had this start occurring to them on the first car they entered.
This bug started occurring today. It appears to be a control related bug, as I noticed specifically that if you hold down W or Up Arrow, you’ll get the car to stop going in reverse, but it’ll not proceed the car forward. (Throttle will be at 0, rather than -1) If you let go of the Up Arrow or W, the car continues back into -1 throttle again.
There seems to be a new bug with the pause menu in ROBLOX where pressing pause forces the vehicles in my game to be stuck in reverse
This happens every single time I press pause, respawning my vehicle doesn’t fix it so I have to rejoin in order to drive this vehicle.
The bug happens on my game which I’m just about to release. The reason I’m reporting this as a roblox bug rather than a scripting mistake, is that I haven’t touched the scripts for this vehicle for multiple months.
This happens in both client and studio now and happens on both of my PC’s, both running Windows 10 1903
How to reproduce this bug
Get in either one of known vehicles in linked place.
@TheGamer101 I also ran into this in SharkBite Classic 🦈 - Roblox on last Saturday, boat kept going backwards and I could get it to halt by holding forward down. Other people in the server didn’t seem to have the issue in the same vehicleseat, so it looks like this bug may have been the issue. Might want to have another look at this.
A few Railway Experiences moduels which rely on the vehicle seat to get the current throttle have started getting stuck in the reverse position. This is probably why.
ps please use UIS to determine which key is down, not throttle
This game uses an old version of the PlayerScripts which doesn’t handle the context action states for vehicle controls correctly.
To fix this bug, in the forked version of the PlayerScripts, replace the following functions in VehicleController with this newer version of them:
function VehicleController:OnThrottleAccel(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.End or inputState == Enum.UserInputState.Cancel then
self.acceleration = 0
else
self.acceleration = -1
end
self.throttle = self.acceleration + self.decceleration
end
function VehicleController:OnThrottleDeccel(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.End or inputState == Enum.UserInputState.Cancel then
self.decceleration = 0
else
self.decceleration = 1
end
self.throttle = self.acceleration + self.decceleration
end
function VehicleController:OnSteerRight(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.End or inputState == Enum.UserInputState.Cancel then
self.turningRight = 0
else
self.turningRight = 1
end
self.steer = self.turningRight + self.turningLeft
end
function VehicleController:OnSteerLeft(actionName, inputState, inputObject)
if inputState == Enum.UserInputState.End or inputState == Enum.UserInputState.Cancel then
self.turningLeft = 0
else
self.turningLeft = -1
end
self.steer = self.turningRight + self.turningLeft
end
If a player opens the Reset/Leave menu while sitting in a VehicleSeat, the Throttle and ThrottleFloat properties are getting reduced by 1 (when not pressing any key it’s -1, when attempting to move forward it’s 0) for any VehicleSeat the player is using.
This bug happens with all VehicleSeats.
Repro
Insert a VehicleSeat.
Run test using Play or Play Here.
Sit on the vehicle seat with your character.
Open the Reset/Leave menu.
Look into the VehicleSeat’s properties. You will notice that the throttle is now -1 when idle and 0 when attempting to go forward.
Standing up and sitting again doesn’t help. The only way to fix this is by rejoining the game.
I was looking back at this code when making my own version of the vehicle seat input into a custom car, and noticed you put decceleration as a positive 1 and acceleration as a negative 1. Is that correct?
Also as a side note, it should be deceleration, not decceleration.
The code I posted is a direct copy from the current VehicleController code and it is correct with respect to the reset of the VehicleController code. Of course it would be more clear if a throttle of -1 wasn’t forward though.