Default Camera Scripts do not reset "panInputCount" accumulator when camera type changes, `getRotationActivated` stuck true

Reproduction Steps

  1. Enable VehicleCamera by setting Camera.CameraSubject to a VehicleSeat.
  2. Hold right click (or pan on a touch device)
  3. Change CameraType to… say… Scriptable
  4. Now change back to Custom so that VehicleCamera is used
  5. 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

9 Likes

Thanks for the report! We’ve filed a ticket to our internal database and we’ll follow up when we have an update for you.

2 Likes