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. Add the component
  • 2. Assign a scriptable object to work with
  • 3. Assign the Vehicle Body Mesh Filter
  • 4. Add new Collision Areas to the List
  • 5. Partition the Mesh
  1. Guides
  2. Vehicle Damage System

Collision Area Partitioner

PreviousVehicle Damage ControllerNextPart Damage Handler

Last updated 9 months ago

Collision Area Partitioner is used to predefine possible collision areas, find what vertices are inside each of the area and save it in a CollisionAreasDataSO scriptable object.

1. Add the component

2. Assign a scriptable object to work with

This component requires scriptable object to already be created. To create a new scriptable object, type the name in the "Collision Areas SO Name" field and click "Create New CollisionAreasDataSO" button. By default it will be saved to the "CustomVehicleController/VehicleController/VehicleParts/CollisionAreas", but you can change it in the "Package Settings" window.

3. Assign the Vehicle Body Mesh Filter

4. Add new Collision Areas to the List

Make sure the "Debug Gizmos" is set to True.

Make sure the Gizmos is enabled in the Scene View (last icon).

Give this collision area a name for easier identification. Set the Center, Height, Width and Length properties to cover the area that you are interested in, like the left side, hood, roof, etc.

Enter the isometric mode in the scene view (three lines icon in the top right).

5. Partition the Mesh

After you are done, click the "Partition the Mesh into Collision Areas" button

The CollisionAreasDataSO scriptable object is ready to be assigned to the VehicleDamageController.

If you want to partition the mesh, you should cover as many areas as possible. All the vertices that don't belong to any collision area will not be deformed.