Custom Vehicle Controller
  • Custom Vehicle Controller
  • Guides
    • Workflow
      • Quick Setup
      • Creating New Parts
      • Modifying Parts
      • Creating Vehicle Parts Presets
      • Customizable Sets and Runtime Parts Change
      • Engine Performance Customization
      • Exposing Current Car Stats
    • API
      • CustomVehicleController
      • VehicleEngineSoundManager
      • RaceManager
      • RacerProgress
      • RaceSpawner
      • CollisionHandler
    • Vehicle Controller Input Provider
      • Input System Example
      • Mobile Input
    • Tips, Warnings and Requiremens
      • Work With Editor
      • Vehicle Set Up
    • AI Setup
      • AI Racer Creation
      • AI Racer Setup
      • AI Chaser Setup
      • Race Creation
      • Race Configuration
      • Race Information
    • Vehicle Damage System
      • Vehicle Damage Controller
      • Collision Area Partitioner
      • Part Damage Handler
      • Vehicle Attachments Aligner
      • Collision Handler
    • Additional Settings
      • Custom Vehicle Controller
      • Car Visuals Essentials
    • Package Settings
      • Assets Save Location
      • Project-Wide Surface Settings
    • Extra
      • Adding Visual Effects
        • Individual Effect Set Up
      • Adding Sound Effects
        • Adding Engine Sound
        • Adding Extra Sound Effects
  • Converting To Other Render Pipelines
    • Convert To Built-in RenderPipeline
    • Convert To HDRP RenderPipeline
Powered by GitBook
On this page
  • 1. Using the built-in component
  • 2. Creating your own input provider
  • Version 1.1.2 added Input Provider script using Input System
  1. Guides

Vehicle Controller Input Provider

Handling user input.

PreviousCollisionHandlerNextInput System Example

Last updated 1 year ago

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