Impact CFX Main Page Index API Reference Change Logs
Legacy Impact Comparison Conversion From Legacy Impact
Impact CFX Project Settings Impact Tags Logging Impact Material Registry
Impact CFX Manager Material Mapping Managing Registered Materials
Impact Materials
Audio Effect Audio Source Prefab Audio Effect Processor Particle Effect Particle System Prefab Particle Effect Processor Decal Effect Decal Prefab Decal Effect Processor URP & HDRP Decals VFX Batch Effect VFX Batch Master Creating a Visual Effect VFX Batch Effect Processor Managing Attached Effects
Impact Objects Impact Object Single Material Impact Object Rigidbody Impact Object Rigidbody (Cheap) Impact Object Custom Velocity Objects With Multiple Materials Impact Terrain
Impact Triggers Common Trigger Properties Material Count Impact Collision Trigger Impact Slide and Roll Trigger Impact Speculative Collision Trigger Impact Simple Collision Trigger Impact Particle Collision Trigger Impact On Trigger Enter Impact On Trigger Stay
Impact Raycasting
FMOD Integration Wwise Integration Master Audio Integration
Custom Triggers Custom Objects Creating an Impact Object Script Impact Material Processors Custom Effects Impact Effect Authoring Asset Effect Result Effect Data Impact Effect Processors Impact Simple Effect Processor Impact Pooled Effect Processor Pooled Effect Object Pooled Effect Authoring Pooled Effect Result Pooled Effect Data Object Pool Pooled Effect Processor Add to Impact CFX Manager Example Effect Download

Impact CFX Manager

To create an Impact CFX Manager, the easiest way is to navigate to GameObject > Impact CFX > Create Impact CFX Manager. An Impact CFX Manager game object will be created in your scene, along with several other objects and components that will likely be needed for the system to function as expected.

You can also add the Impact CFX Manager component by itself by going to Add Component > Impact CFX > Impact CFX Manager.

Once you have an Impact CFX Manager, there are several properties you can edit.

  • Collision Queue Capacity – The maximum number of collisions that can be processed in a single frame.
  • Collision Limits – Optional limits for the different kinds of collisions. Setting limits can help prevent the Collision Capacity being used up by one particular type of collision. For example, Unity calls all OnCollisionEnter methods before OnCollisionStay, and so when a lot of collisions are happening, the Collision Capacity may get filled up before OnCollisionStay is called.
  • Material Queue Capacity – The capacity of the array used to gather material data from the colliding objects. This should be at least twice as much as the Collision Queue Capacity, to allow for at least 1 material for both objects involved in a collision.
  • Impact Effect Processors – These are processors used for calculating the results for specific effect types (e.g. Audio, Particle, and Decal). Processors must be present for the corresponding effect type to be played.
  • Impact Material Processors – These are processors used for retrieving Impact Materials for specific object types. Processors must be present for material data to be retrieved from the corresponding object type.
  • Material Mapping – The processor used for Material Mapping.
  • Material Registry – An Impact Material Registry that contains materials to pre-load. If an Impact Material is not present in the registry, effects will not work for it.
  • Don't Destroy On Load – Make this manager and its effects persist between level loads. If you want to have separate Impact CFX Managers in each scene, disable this.
  • Set as Active Instance – Make this manager the primary Impact CFX Manager instance on Awake.

Material Mapping

Material Mapping allows you to map Unity's Physics Materials to Impact Materials. This is useful so that you don't necessarily have to add an Impact Object component to all of the objects in your scene.

The Impact Material Mapping Processor is responsible for handling material mapping. This component is automatically created if you used the Create Impact CFX Manager option above, but you can manually add this component by going to Add Component > Impact CFX > Impact Material Mapping Processor.

Simply add an entry to the list, assign a Physic Material or Physics Material 2D, and assign the Impact Material it will map to.

The Capacity property defines how many materials the processor can process in a single frame. This automatically matches the Material Capacity of the Impact CFX Manager, but you can override it if you wish.

If the Register Materials On Start property is enabled, all Impact Materials defined in the mappings will automatically be registered with the Impact CFX Manager.

Managing Registered Materials

As mentioned in previous sections, Impact Materials must be registered with the Impact CFX Manager in order to work. Impact CFX provides several options for registering Impact Materials.

  • Impact Material Registry - You can create an Impact Material Registry asset and assign it to your Impact CFX Manager so that all materials and effects in the registry will be pre-loaded on Start. This has the benefit of loading everything up-front so that there are no loading hitches during gameplay.
  • Register Materials On Start - Individual Impact Objects as well as some other components have the option to register their own materials when they load. This has the benefit that you don't have to maintain an Impact Material Registry, and it also ensures that the materials an object uses will always be registered. However, the downside is that first-time loading of the effects can cause hitches during gameplay.
  • Scripting API - ImpactCFXGlobal and ImpactCFXManager have methods that allow you to manually manage registered materials from your own scripts. This gives you the most control over how materials are registered. See the API Reference for ImpactCFXGlobal and ImpactCFXManager for more details.