API reference
BallisticSurface
Public penetration and ricochet settings.
Source: src/Ballistics/BallisticSurface.cs. All fields below are read/write.
| Field | Type | Meaning |
|---|---|---|
m_penetrationEnabled | bool | Enable penetration. |
m_penetrationEnergyConsumptionPercent | float | Energy loss fraction, 0–1, repeated over thickness steps. |
m_minEnergyToPenetrateInMetrics | float | Penetration entry threshold in joules. |
m_penetrationDeflectionAngles | Vector2 | Minimum/maximum randomized exit-deflection settings. |
m_ricochetEnabled | bool | Enable ricochet. |
m_ricochetEnergyConsumptionPercent | float | Energy loss fraction, 0–1, applied once at impact. |
m_minEnergyToRicochetInMetrics | float | Ricochet threshold in joules. |
m_ricochetDeflectionAngles | Vector2 | Minimum/maximum randomized reflection-deflection settings. |
The field names use Energy, not the misspelling Enegry in the old API table. The threshold names end in InMetrics (plural). Both thresholds use a strict greater-than comparison.
SurfacePreset values are Custom, Wood, HardWood, Metal, Steel, LightSteel, Plastic and Cloth. Presets and measurement display are configured in the custom Inspector. Runtime fields remain metric even if the Inspector displays imperial units.
The system checks penetration before ricochet. It finds the component on hit.transform using GetComponent; it does not search parents.