Collision Handler
Last updated
Last updated
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).
Events pass information about collision. See CollisionHandler API for details.