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. Guides
  2. Vehicle Damage System

Collision Handler

PreviousVehicle Attachments AlignerNextAdditional Settings

Last updated 9 months ago

Collision handler is a component that detects collisions on a Rigidbody, gathers information about the collision and sends it to the listeners.

To use the CollisionHandler, assign it to the root game object, where Rigidbody component is attached.

Drag and drop the Rigidbody into the object field and, optionally, set the values to other fields.

MinCollisionSpeed - speed in metres per second;

ImpactCollisionCooldown - the amount of time that must pass before triggering another impact collision event.

Then, in your own scripts, or the scripts that come with this package, like VehicleDamageController, VehicleExtraSoundManager and CarVisualsExtra, get a reference to the CollisionHandler component.

In code, subscribe to events as you see fit.

Don't forget to unsubscribe from the events (usually in the OnDestroy method).

Collision Information

Events pass information about collision. See CollisionHandler API for details.