Reproduction Steps
- Enable VehicleCamera by setting
Camera.CameraSubject
to a VehicleSeat. - Hold right click (or pan on a touch device)
- Change CameraType to… say… Scriptable
- Now change back to Custom so that VehicleCamera is used
- Drive forward and observe that VehicleCamera will no longer track/follow the vehicle properly
Expected Behavior
On step 5, VehicleCamera should work as expected and follow vehicle
Actual Behavior
Instead it thinks you are constantly holding down right click/panning camera and there is no way resolve, so the camera just stays stuck forward, and does not follow vehicle.
Workaround
The VehicleCamera camera type (which can be enabled by setting Camera.CameraSubject
to be a VehicleSeat) makes use of a function in CameraInput.getRotationActivated()
which checks if panInputCount > 0
This panInputCount
value is incremented when you right click, decremented when you release (InputEnded). The problem is InputEnded event is removed when CameraType is set to Scriptable, so it never gets decremented, so when input events are connected again, it’s stuck with an accumulated 1. All other input/touch state is reset every time CameraInput.setInputEnabled
except it looks like this one value panInputCount
does not. So perhaps in resetInputDevices
function where all keyboard/gamepad/etc. state is set to 0, there should also be panInputCount = 0
– this fixes it locally.
Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Constantly