Chaos Vehicle Set Target Gear Strange Behavior

Hi,
I disabled ReverseAsBrake in VehicleMovementComponent so I can set the gear I want for reverse and forward, it works as expected however there’s a strange behavior when the vehicle is stationary and you change the gears twice while still stationary.

For example:

  • Put gear in reverse, move the car it moves in reverse which is expected.
  • Stop the vehicle and put the gear to forward and back to reverse again.
    Result: Car moves forward ignoring the set gear to reverse.

Here’s a video demo:
I used 2 buttons to set the target gear

I figured it out, it’s caused by some vehicle sleep behavior, once I disabled It solved a lot of weird issues with chaos vehicle component.
Console command.
p.Vehicle.DisableVehicleSleep 1

The vehicle wakes up when certain events happen like controls (accelerating, braking etc) or something like collision. I think SetTargetGear should also wake up the vehicle or at least recognize the new gear especially with the Immediate flag set to true.

For controls there’s this flag
p.Vehicle.ControlInputWakeTolerance //Default value 0.02

This was one of the ways I kept the vehicle awake, I simply kept the throttle at 0.02 which prevented the vehicle from sleeping.

There’s a Sleep threshold in the Vehicle movement component you can set to 0 to disable it, however setting it to 0 does nothing from my testing.

3 Likes