Modify vehicle inputs
Modifying vehicle input in BMSDK is only possible in offline modes or local games. Since this is a frequent ask, here is a resource page on how to do it.
Many aspiring programmers find the CarWrapper::SetInput function and think that their prayers are answered. Unfortunately, this function does not work particularly well. It is best to steer clear of this one entirely.
The function PlayerControllerWrapper::SetVehicleInput is simple to use and works well enough for most purposes. However, some users have noticed that it does have minor inconsistencies, which can compound in sensitive cases like a TAS tool. If that is something you care about, you can use the hook (described below) instead.
The hook SetVehicleInput is the best way to control car inputs, but it also requires some more work than the above function. This code snippet shows a working example:
|
|
This hook runs once per car, every physics tick.