I want to make an ImpactManager. The script will spawn a specific effect for a combination of surface and impact type, defined in a scriptable object. For example "Surface: Metal" and "ImpactType: Bullet" will result it "MetalBulletSparks" spawning.
My question is, what would be the best way (simplicity, ease of use and performance wise) to define/read a surface? First I saw a tutorial that somehow got the texture of the object it hit, but that system seems very performance intensive and doesn't make sense to me. Then I thought about using the material on the GameObject it hit, but then I realized sometimes colliders are separate from the visual GameObjects that hold the materials, so I can't always use that.
The only methods I can think of that could work is attaching an identifier to each collider, like a script with scriptable object. I also thought about giving every collider a physics material and use that to identify the type of surface, in that case I only need to get that and not the whole GameObject. But idk if giving every collider a physics material uses up extra resources??
So please let me know what you think is the best way to solve this problem, or are there any other standard ways that are commonly used for this?