# Collisions and CollisionEffectsData

### Collision Manager

The <mark style="color:green;">CollisionManager</mark> is a component which sits on the same <mark style="color:green;">GameObject</mark> as the <mark style="color:green;">Rigidbody</mark> and captures the collision events, then invokes its own events for the AVC components that require them.

![CollisionManager component](https://1552885336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAvcCremCCxL7EEPDdj%2Fuploads%2F4x6BuZza09oo5qQ10UrZ%2FCollisionManager.png?alt=media\&token=58202567-bd51-4b28-bd2c-4a31cd119eb1)

### Events

These events are public and free for you to use anyway you should need. Just get a reference to the CollisionManager and then subscribe to the following.

<mark style="color:purple;">Action\<Collision> OnVehicleCollisionEnter</mark>

<mark style="color:purple;">Action\<Collision> OnVehicleCollisionExit</mark>

<mark style="color:purple;">Action\<Collision> OnVehicleCollisionStay</mark>

### CollisionEffectsData

The CollisionEffectsData holds the information required for collisions.

![CollisionEffectsData inspector window](https://1552885336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAvcCremCCxL7EEPDdj%2Fuploads%2FBRIs7PW9rG1s0jPlWspY%2FCollisionEffectsData.png?alt=media\&token=fa3463fd-f112-4c28-b15f-069e8245e6e9)

**Effects ID** (optional) - Enter a name for this effect, if you are using a 'Custom' CollisionType, otherwise it can be left blank.

**Collision Type** - Select the type of collision this asset is for. There currently only options Default and Custom.

**Effect Prefab** - Assign the prefab that should be spawned when this collision occurs. Two example prefabs are included with AVC.

**Required Speed** - Set this to the minimum speed you want your vehicle to be moving for this effect to spawn.

### Collision Tag

This component is used by AVC for spawning custom effects on collisions, add this to any object you wish to have a custom particle system spawn when hit, enter the required CollisionID, and as long as the CollisionEffectsData for it is added to the vehicles, then this effect will spawn on collision.

![CollisionTag component](https://1552885336-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAvcCremCCxL7EEPDdj%2Fuploads%2FBUqF6GK6zKfGKjTBRGLW%2FCollisionTag.png?alt=media\&token=3f179080-f618-4164-a6ed-aa0ed2b5f882)
