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 exemplary prefab
  • 2. Adding you own controls
  1. Guides
  2. Vehicle Controller Input Provider

Mobile Input

PreviousInput System ExampleNextTips, Warnings and Requiremens

Last updated 9 months ago

To easily configure mobile inputs, make sure InputSystem package is installed

1. Using the exemplary prefab

Locate the mobile UI controls prefab in "CustomVehicleController/Demo/Prefabs/UI".

Drag and drop it into the canvas in the scene.

Delete the "YouCanDeleteThis" game object. It has buttons that make calls to the DemoManager to swap presets and change drivetrain as well as set the "LeftStick" and "SteerButtons" active/inactive.

If you want to change the image of the buttons, locate the needed game object and change the sprite.

Make sure the image you want to assign is imported as a Sprite.

2. Adding you own controls

First of all, add a component that extends IVehicleControllerInputProvider and uses the new InputSystem to the the same gameobject where the CustomVehicleController is attached. You can use the "VehicleInputProviderDemo" component that comes with this package, or make your own script.

Then, locate the input action asset and open it. If you are using the "VehicleInputProviderDemo", open the input actions asset the asset at "CustomVehicleController/VehicleController/Scripts/Input". If your custom script doesn't use this asset, find you own one.

Find the action that you are interested in and remember path.

Add new Image to the Canvas.

Add the "On-Screen Button" or "On-Screen Stick" component.

In the "Control Path" select the path for the action.