SimulationManager::SetInputState Method

Sets the state of an input.

Syntax

void SimulationManager::SetInputState(
InputType state,
int value
)

Parameters

InputType state
The input to type set the state of.

int value
The new value of the input. If an input is analog (InputType::Steer and InputType::Gas), the value should be between -65536 and 65536. If the value is binary, it should be either 0 or 1.

Return value

None.

Remarks

Sets individual input states for the car. If successfully applied, key states are guaranteed to be applied at next physics tick. If you want to apply an input state that happens at 500ms, call this function at 490ms (one step before).

Note that it is not guaranteed that the game will actually process the input in the race mode. This can happen when setting the game speed to high factors (such as >100). This does not affect the simulation context.

In a simulation context, TMInterface will add new input events to the existing event buffer such that that the next tick has the desired input state.