Sometimes the VehicleSeat.Throttle doesn’t update when the user wants to go forward, I’ve already tried replacing Throttle with ThrottleFloat, and the same issue persists. Currently, when the user spawns in a car I make the player sit down using VehicleSeat:Sit(player.Humanoid) and the player can go ahead and drive around. However once in a blue moon, once the player is seated, the vehicle doesn’t move. Why is this happening? This bug doesn’t happen in studio, only on the Roblox app. I know this post is similar to this post made by Intended_Pun(VehicleSeat.Throttle does not change when player is put in seat with Sit() function) however that post is over 6 years old and unresolved.
Here is also the code for the script that detects if you’re pressing W if I somehow messed that up; It’s located in PlayerScripts and it’s a local script
game:GetService("UserInputService").InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
print("W pressed; User is attempting to go forward")
end
end)
game:GetService("UserInputService").InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W then
print("W depressed; User has stopped the attempt")
end
end)
therefor there is no code for the vehicle movement. The only related bit of code is when I teleport the player to the VehicleSeat.
game:GetService("ReplicatedStorage"):WaitForChild("Spawn").OnServerEvent:Connect(function(player, vehicle)
local truck = game.ServerStorage.one.Truck
local clone = truck:Clone()
clone.Parent = workspace
clone:MakeJoints()
clone:WaitForChild("VehicleSeat"):Sit(player.Character:WaitForChild("Humanoid"))
end)
There are no errors in the output and currently, the code forces the player to sit in the seat, but once they are sat the vehicle seat isn’t detecting player inputs sometime. I tested that by adding this in the vehicle seat:
script.Parent.Changed:Connect(function(property)
if property == "Throttle" or property = "ThrottleFloat" end
print("Player input")
else
print(property)
end
end)
I found out that the VehicleSeat never changed the Throttle or ThrottleFloat.
Strangely, this only happens in the Roblox application, not studio, everything works on studio.
This is too crammed together. Give it a pause after it’s found, then sit the player.
These one line covers it all lead to timing errors.
Same for things like this … player.Character:WaitForChild(“Humanoid”).
It works more or less, but Humanoid being define before use is always better.
This is on the fly programming… Top down programming is the way to go.
(yes, I’m beyond picky)