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
  • Surface Properties Explained:
  • Managing the Surface Settings
  1. Guides
  2. Package Settings

Project-Wide Surface Settings

PreviousAssets Save LocationNextExtra

Last updated 7 months ago

In order to add surface-specific properties that affect the vehicle behavior, open the Package Settings window.

Open the window by going to Tools -> CustomVehicleController -> Package Settings.

You will see a foldout where you can:

  1. Enable/Disable this feature

  2. Associate the physic material and the surface properties

Disabling the project-wide surface settings means that when the wheels will ask for properties depending on the physic material that they hit with raycast, they will get the default surface with

  1. 0 Surface Roughness

  2. 1 Acceleration Friction

  3. 1 Steering Friction

  4. 0 Surface Drag

Surface Properties Explained:

  1. Surface Roughness - defines how bumpy the surface is. This is purely for a shaking visual effect, which can be enabled on the CarVisualsEssentials component. Acts as a shaking effect strength multiplier.

  2. Acceleration Friction - a multiplier to the car's acceleration friction.

  3. Steering Friction - a multiplier to the car's steering friction.

  4. Surface Drag - additional drag to the car's rigidbody. The actual amount that will be added to the rigidbody is scaled with the amount of wheels on this surface, so for the full effect all the wheels must be in contact, otherwise the effect will be lessened.

Acceleration and Steering Friction parameters affect only the wheels that are actually in contact with this surface.

Managing the Surface Settings

  1. To add the new surface setting, click the "New Surface Property" Button.

  1. To remove the setting, click on the "X" button on the right of the setting.

  1. After you create a new entry to the surfaces list, assign a physic material.

  1. Modify the parameters

  1. Assign the physic material to the road's collider component

The actual values on the Physic Material have no effect on the vehicle's behavior. However, they still affect how the car responds to the collisions, therefore you can modify the Physic Material properties and lower them to reduce the negative impact on the ground collisions that reduce the car's speed, therefore making the driving less fun and more slow.

If you leave the physic material field as NULL in the Project-Wide Surface Settings tab, when the surface parameters will be requested by the wheel, it will receive the default (0,1,1,0) surface properties, even if you set your own surface properties.

The physic material and surface settings are stored as 2 separate lists, which get converted to the dictionary at runtime. Therefore, you cannot have the same physic materials in the list because a dictionary can only have unique keys. If you have more than 1 physic material in the list, only the first one will be added to the dictionary.

You can check the Scriptable Object that holds the project surface settings at "CustomVehicleController/VehicleController/Resources". Since the amount of items in lists must match, this asset is read-only and can only be modified from the settings window.

In order to create new Physic Materials, click RMB in the Assets folder and navigate: