Vehicle Controller Input Provider

Handling user input.

1. Using the built-in component

The CustomVehicleController comes with the VehicleControllerInputProvider script for handling user input. It uses old Unity's input system and doesn't require anything to work. You can simply assign this component to the GameObject with the CustomVehicleController component.

2. Creating your own input provider

A CustomVehicleController component requires a MonoBehaviour that implements the IVehicleControllerInputProvider interface.

  1. Create new script

  2. Inherit from IVehicleControllerInputProvider

  1. Implement the interface

  1. Assign a new script to the game object with the CustomVehicleController component.

In the Awake method, the Custom Vehicle Controller searches for the component that implements the IVehicleControllerInputProvider interface. If no such component is found, then:

  1. If the Input System is installed, the "VehicleInputProviderDemo" component, which uses the Input System, will be added.

  2. If the Input System is not installed, the "VehicleControllerInputProvider" component, which uses the Input Manager, will be added.

If more than 1 components are found, the first one will be used.

Version 1.1.2 added Input Provider script using Input System

If you have Input System package installed, just add a "Vehicle Input Provider Demo" component. Otherwise, following the first step from the Input System Example, install the package and then add the component.

If you want to implement your own version of input handling script, see the example using the Input System.

Input System Example

Last updated