I am creating a driving game that requires movement at all times. However, I don't understand why, in this script, only one button press is registering at a time. For example, when I hold W and then A simultaneously, the car stops moving forwards and turns left.
function onKeyDown(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.W then
turn.AngularVelocity = Vector3.new(0,0,0)
end
if inputObject.KeyCode == Enum.KeyCode.S then
turn.AngularVelocity = Vector3.new(0,0,0)
end
if inputObject.KeyCode == Enum.KeyCode.A then
turn.AngularVelocity = Vector3.new(0,0,0)
end
if inputObject.KeyCode == Enum.KeyCode.D then
turn.AngularVelocity = Vector3.new(0,0,0)
end
end
input.InputBegan:connect(onKeyUp)
