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. Engine Part Type Creation
  • 2. Engine Part Type Deletion
  • 3. Engine Part Creation
  • 4. Engine Part Settings
  • 5. Assigning engine parts
  1. Guides
  2. Workflow

Engine Performance Customization

Learn how to make your own engine part types to add deeper performance customization to your game.

PreviousCustomizable Sets and Runtime Parts ChangeNextExposing Current Car Stats

Last updated 1 year ago

Version 1.1.0 added engine performance customization to the asset.

First of all, open engine part creation window by going to Tools -> CustomVehicleController -> Engine Part Creator Window

In this window you can create and delete engine part types and make instances of part types that are currently in the project.

1. Engine Part Type Creation

Open the "Engine Part Type Management" foldout, enter a name and click "Create New Engine Part Type"

This will create a new class that derives from CustomEnginePart class. The folder will be created at "CustomVehicleController/VehicleController/VehicleParts/EngineParts/" with the specified name. A csharp file will be created in this folder.

2. Engine Part Type Deletion

Open the "Engine Part Type Management" foldout, select the engine type from the foldout and click "Delete selected part type"

This will delete a folder and every file that existed in it at a location "CustomVehicleController/VehicleController/VehicleParts/EngineParts/(selected type)".

3. Engine Part Creation

Open the "Engine Part Settings" foldout.

In the "Engine Part Type" dropdown select engine part type that exists in the project. Enter a name of the asset in the "New Asset Name" text field and click "Create New Asset". This will create a scriptable object of the selected type at location "CustomVehicleController/VehicleController/VehicleParts/EngineParts/(selected type)".

4. Engine Part Settings

Open the "Engine Part Settings" foldout.

In the "Engine Part Type" dropdown select engine part type that exists in the project.

Select engine part asset in the "(selected type) SO" object field.

Here is the explanation for each field.

Field Name
Description

Torque Increase

The amount of torque that will be added to the engine.

Non-linear boost

If toggled, the engine will read the value from the EffectCurve.

Effect Curve

Animation Curve that holds the keys with time keys [0;1]. The engine will read the value from the EffectCurve using the engine rpm percent and use it as a multiplier to the Torque Increase value.

Change Working RPM

If toggled, the engine will modify it's idle and maximum rpm values based on the IdleRPMChange and MaxRPMChange values.

IdleRPMChange

The change of idle rpm of the engine.

MaxRPMChange

The change of maximum rpm of the engine

5. Assigning engine parts

Engine parts can be assigned from code and the "Engine Part Creator Window"

5.1 From the editor

Open the "engine part creator window" and select a gameobject with a CustomVehicleController script on it. The "Engine Parts Container" will have a list with fields for every engine part type that exist in the project.

Assign the engine part to their appropriate fields by selecting them from the object field:

A vehicle controller can only contain 1 part of each type of engine parts.

5.1 From code

Get a reference to the CustomVehicleController script (for example, by calling GetComponent<CustomVehicleController>).

Call a "SetNewEnginePart(CustomEnginePart newPart)" method and pass in an instance of any engine part that you created (every engine part type that you create derives from the CustomEnginePart class). If the vehicle controller already has a part of that type, the part will be changed, otherwise a new part type field will be added with a new part as a value.