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
  • Using Customizable Sets
  • Updating Parts at Runtime
  1. Guides
  2. Workflow

Customizable Sets and Runtime Parts Change

PreviousCreating Vehicle Parts PresetsNextEngine Performance Customization

Last updated 10 months ago

Using Customizable Sets

Instead of presets, CustomVehicleController can use individually assigned parts. This ensures a safe modification to the parts the vehicle is using without affecting other vehicles.

Either in the inspector or editor window turn off the "Use Preset" toggle.

Assign parts either in the inspector or editor window. When a controller is selected, changes to the parts object fields in the editor are applied to the controller as well.

Updating Parts at Runtime

Changes to the parts that the CustomVehicleController is using can be made from an external script.

  1. Get a reference to the CustomVehicleController script

  2. Have a reference to some vehicle part scriptable object that you wish to change to.

  3. Call the "SetNewPartToCustomizableSet" from the controller script and pass the desired scriptable object. This method expects a scriptable object that extends the IVehiclePart interface (every vehicle part does) and, optionally, a boolean for whether the part is front or rear (in the case of suspension and tire parts).

You can safely change between presets and customizable sets at runtime as long as neither has Null object fields.