A complete solution for destructible objects, openable containers, and dynamic loot drops. Plug-and-play for level designers with a full public API for programmers.
Add the DPT_InteractiveProp component to any GameObject, assign the required references in the Inspector, and you are ready to go. The included prefabs are pre-configured; no setup is required to test them immediately.
DPT_InteractiveProp component.| Input | Behaviour |
|---|---|
| Left-click | Damages the prop. If Instant Break On Click is enabled, the prop shatters immediately. Otherwise, each click applies 50 damage. |
| Right-click | Opens the prop. Right-clicking again closes it, unless the lid has physically detached - in that case, it will not reattach. |
The included prefabs are configured for maximum performance. You can adjust these settings on any debris Rigidbody depending on the visual quality you need.
| Setting | Maximum Performance | Smoother / Cinematic |
|---|---|---|
| Interpolate | None | Interpolate |
| Collision Detection | Discrete | Continuous Dynamic (recommended for fast-moving shards) |
The component is organised into logical groups in the Inspector. Each group is described below. The Inspector is fully dynamic—certain fields and entire sub-sections will only become visible once their parent feature is configured or enabled.
The foundational references that wire your GameObjects into the system. These must be assigned before any other settings become meaningful.
| Field | Description |
|---|---|
| Pristine Meshes | The intact visual meshes. These are automatically hidden when the prop breaks. |
| Unbroken Collider Roots | GameObjects containing the colliders used while the prop is intact. |
| Broken Parent | The parent GameObject holding all fractured debris. Must be disabled in the hierarchy by default. Assigning this field unlocks the Fracture & Explosion Physics category. |
| Linked Props | Other DPT_InteractiveProp objects that break automatically when this prop breaks. Useful for destruction chains - barricades, supports, grouped structures. Circular references are safe. All parent objects in the list must have the DPT_InteractiveProps component. You can drag objects into the field, or click Add Selected, or Add Children if all the objects are the child of 1 DPT_InteractiveProps object. Clear all empties the list.
Performance & Bulk Assignment Note: Due to Unity Inspector serialization and layout limitations, dragging and dropping or using Add Selected is optimized for batches of up to ~60 objects at a time. For massive destruction chains exceeding this size, organize the target props under a single parent object and use Add Children to bypass this threshold efficiently.
|
Core settings that govern how the prop receives damage, responds to input, and manages its physical state before destruction.
| Field | Description |
|---|---|
| Max Health | Total damage the prop can take before shattering. |
| Instant Break On Click | Debug toggle. When enabled, a single left-click destroys the prop instantly rather than applying 50 damage per click. |
| Enable Mouse Interaction | Allows the prop to be tested with direct mouse input. Left-click to damage, right-click to open/close. Disable this when integrating with your own interaction system. Supports both the Legacy Input Manager and the New Input System. |
| Start Non-Kinematic | If enabled, the intact prop's Rigidbody starts fully simulated from the first frame, allowing gravity and collisions to affect it before destruction. |
| Lock LOD On Open | Forces the LODGroup to LOD 0 while the prop is open, preventing lower-detail meshes from showing closed geometry. |
Controls whether physics collisions can directly damage or destroy the prop.
| Field | Description |
|---|---|
| Break On Impact | Allows physics collisions to trigger damage and destruction. |
| Impact Velocity Threshold | The minimum collision velocity required to register an impact. Only visible when Break On Impact is enabled. |
Dynamic Visibility - Animation & Physics Settings: All fields in this section are completely hidden until a Transform is assigned to the Lid Or Door slot. Assign a lid or door object first and these settings will appear automatically.
| Field | Description |
|---|---|
| Lid Or Door | The Transform of the lid or door object. |
| Broken Lid Parent | Optional parent containing fractured lid debris, activated when the lid detaches. |
| Lid Detach Distance | How far the lid can travel from its origin before being considered permanently detached. Once detached, right-clicking will no longer reattach it. |
| Disable Kinematic On Open | Disables isKinematic on the main root Rigidbody when opened, turning a heavy static container into a lightweight pushable physics object once opened or looted. |
| Enable Kinematic On Close | If true, re-enables isKinematic on the main root Rigidbody when the prop is fully closed, turning a pushable object back into an immovable, static world element. |
| Auto Close After Time | Automatically closes the prop after a set delay. |
| Auto Close Delay | The delay in seconds before automatic closure. Only applies when Auto Close After Time is enabled. |
| Open Position / Rotation Offset | The target local position and rotation used when animating the lid open. |
| Open Speed | How quickly the lid interpolates toward its open position during animation. |
| Lid Always Breaks | If enabled, the lid always breaks, even if the lid is not near or attached to the parent object. |
| Use Physics On Open | Ignores animation offsets and instead flings the lid open using physics impulses. Requires a Rigidbody on the lid with appropriate mass, drag, and colliders. |
| Lid Open Upward Force | Upward impulse force applied to the lid during physics-based opening. |
| Lid Open Forward Force | Forward impulse force applied to the lid during physics-based opening. |
| Lid Open Sideways Force | Sideways impulse force applied to the lid during physics-based opening. |
Controls how fractured debris behaves at the moment of destruction.
Dynamic Visibility: All fields in this category are completely hidden until a prefab is assigned to the Broken Parent slot in Core Object Setup.
| Field | Description |
|---|---|
| Broken Base Pieces | Heavier debris pieces such as crate bottoms or structural supports. These can be locked in place or given reduced force to feel more grounded. |
| Lock Base Piece | Prevents base pieces from moving on destruction. Useful for anchored structures like barricades. |
| Explosion Force | The baseline force applied to all debris on destruction. |
| Internal Shatter Radius | Defines the absolute physical sphere of influence for the internal explosion force when the object breaks. |
| Explosion Y Offset | Vertically offsets the origin point of the explosion force. Positive values raise the source upward; negative values lower it, allowing you to tune where the blast originates. |
| Base Force Multiplier | Scales down the explosion force on base pieces so they feel heavier than smaller debris fragments. |
| Use Directional Impact | If enabled, debris is pushed away from the hit point instead of exploding outward from the prop's center. |
| Directional Impact Force | Additional force applied in the direction away from the impact point. Only active when Use Directional Impact is enabled. |
| Debris Cleanup | How long debris remains in the scene before cleanup begins. |
| Time Before Cleanup | How long debris remains in the scene before cleanup begins. |
| Sink Speed | How quickly debris sinks into the ground during the cleanup phase. |
| Destroy On Cleanup | If enabled, the entire prop GameObject is destroyed after cleanup. If disabled, the prop deactivates itself instead (use for object pooling). |
| Despawn Base Piece | If disabled, assigned base pieces remain in the scene permanently while smaller debris cleans up as normal. |
| Show Explosion Gizmo | Displays the explosion radius and kinetic transfer radius as wireframe spheres in the Scene view. |
| Explosion Gizmo | Inner Ring (crimson): Driven by Internal Shatter Radius. Marks the physical blast cutoff. Outer Disk (translucent orange): Scales dynamically with Explosion Force and the mass values. |
ResetProp() on the object before returning it to the pool. This fully restores the prop to its pristine state.
Allows the prop's destruction to push nearby physics objects, adding physical weight and interactivity to explosions.
| Field | Description |
|---|---|
| Transfer Kinetic Energy | Master toggle for nearby object force transfer. |
| Kinetic Transfer Radius | Search radius for nearby Rigidbody objects. Visualized as a blue wireframe sphere in the Scene view when Show Explosion Gizmo is enabled. |
| Kinetic Transfer Force | The strength of the force applied to nearby objects. |
| Kinetic Upward Modifier | Adds upward lift so nearby objects pop upward rather than only sliding sideways. |
| Max Pushable Mass | Rigidbodies heavier than this value are ignored, preventing lightweight props from pushing large heavy objects unrealistically. |
These settings determine the core logic for how loot items are managed, chosen, and handled physically when a container opens or breaks.
| Field | Description |
|---|---|
| Loot Mode |
None - Disables loot entirely. PreSpawnHidden - Instantiates loot on Start(), places it on the floor, and hides it. Best for performance. BurstOnEvent - Instantiates and launches the loot at the exact moment the prop opens/breaks. ManualPlacement - Allows you to link pre-existing objects in your scene to be hidden on start and revealed upon opening. |
| Drop Loot On Open | If enabled, loot spawns/reveals when the prop is opened. If disabled, loot only triggers on destruction. Loot can only trigger once per lifecycle regardless (Can be reset in the inspector). |
| Drop Chance Percent | Probability (0-100) that the loot event will happen at all. |
| Loot Uses Directional Impact | Enable this setting to dynamically blast loot outward from the exact point of impact (overrides the default burst trajectory). |
| Field | Description |
|---|---|
| Loot Pool | Pool of potential loot items. A random item from this list will be chosen per individual drop attempt. |
| Loot Count | How many total loot objects should spawn from the selection pool. |
| Custom Loot Spawn Area | Optional: Assign a BoxCollider (set as IsTrigger) to strictly confine where loot spawns. If left empty, loot spawns near the center of the prop. |
| Release Loot Non-Kinematic | If true, revealed loot will become non-kinematic and use the physics engine to fall or burst. If false, it remains completely static in the air/on the ground. |
| Field | Description |
|---|---|
| Burst Direction | The primary Vector3 direction the loot will be thrown (e.g., Up and Forward for a chest). A yellow line will project this in the Scene View. |
| Burst Spread | Slider (0 to 1) controlling the scatter arc. 0 creates a straight line. 1 creates a full 360-degree spherical scatter. |
| Loot Burst Power | The physical force multiplier applied to push the objects outward along the trajectory. |
| Field | Description |
|---|---|
| Manually Placed Loot | A list of specific GameObjects currently in your scene hierarchy. The script will automatically hide them at startup and reveal them when the container opens/breaks. |
Pre-Spawn vs Burst Optimization: Avoid using BurstOnEvent for large numbers of props breaking simultaneously. Instantiating objects and calculating physics forces on the exact same frame causes CPU spikes. For densely packed rooms, set props to PreSpawnHidden to offload the calculations to the scene's startup phase.
| Field | Description |
|---|---|
| Optimize Loot Physics | If true, automatically sets loot rigidbodies to Interpolate and Continuous collision detection to prevent micro-stuttering and clipping through floors. |
| Cleanup Loot | If true, spawned loot items will automatically despawn after a set duration to save memory. |
| Loot Time Before Cleanup | Time in seconds before the spawned loot items begin sinking and despawning. |
| Loot Sink Speed | Speed at which the loot sinks dynamically through the ground during the cleanup phase. |
| Field | Description |
|---|---|
| Break Sounds | An array pool of audio clips. The script randomly selects one to play when the prop shatters. |
| Open Sounds | An array pool of audio clips. The script randomly selects one to play when the container opens. |
| Close Sounds | An array pool of audio clips. The script randomly selects one to play when the container closes. |
| Pitch Variance | Pitch variance applied to all sounds (open, close, break). Higher values create more acoustic variety. |
| Particle Shatter VFX | Optional particle effect spawned at the prop's position when it breaks. |
| On Break Event | A standard UnityEvent fired when the prop breaks. Wire up any external gameplay logic here. |
| On Open Event | A standard UnityEvent fired when the prop opens. Use it in the same way as On Break Event. |
| On Close Event | A standard UnityEvent fired when the prop closes automatically or via script execution. |
| Shatter Prop | Open Prop | Reset Prop |
|---|---|---|
| Breaks the prop instantly. In Edit Mode, physics simulate for approximately 2 seconds so you can preview explosion force, debris movement, and kinetic transfer without entering Play Mode. | Triggers the opening sequence. If Use Physics On Open is enabled, physics simulate in Edit Mode for approximately 2 seconds so you can preview lid motion and trajectory. | Fully restores the prop to its original pristine state, including mesh visibility, lid positions, all debris transforms, health values, and internal physics state. |
All major interactions are exposed as public methods for integration with custom gameplay systems. Disable Enable Mouse Interaction and call these from your own scripts.
| Method | Description |
|---|---|
TakeDamage(float amount, Vector3 hitPoint) | Applies the specified damage to the prop. If health reaches zero the prop breaks, using the hit point to calculate directional debris force. |
BreakProp() | Instantly shatters the prop with a standard outward explosion from its center. |
BreakProp(Vector3 hitPoint) | Instantly shatters the prop with directional force calculated from the supplied world-space position. |
| Method | Description |
|---|---|
OpenProp() | Triggers the full opening sequence including animation or physics impulse, loot spawning if configured, and the On Open UnityEvent. |
CloseProp() | Returns the lid or door to its original position. Has no effect if the lid has permanently detached. |
| Method | Description |
|---|---|
ResetProp() | Fully restores the prop to its pristine state. Use this for gameplay resets, level restarts, and returning objects to a pool. |
EnsureEditorCache() | Caches original transforms, physics references, and internal component data. Runs automatically on Start and during editor test operations. You do not normally need to call this manually. |
ResetProp() or rebuild the instance manually to restore correct behavior.
This section summarises the integration design of the system for developers connecting it to custom gameplay code.
| Area | Description |
|---|---|
| Public methods | All major interactions - damaging, breaking, opening, closing, and resetting - are fully exposed as public methods. No reflection or workarounds are needed. |
| UnityEvents | On Break Event and On Open Event are standard UnityEvents. Wire up any external logic directly in the Inspector without writing additional glue code. |
| Mouse interaction | The built-in mouse interaction is intended for testing and prototyping only. Disable it before shipping and drive the prop entirely through your own system's calls. |
| Input system | The mouse interaction code supports both the Legacy Input Manager and the New Input System via Unity preprocessor directives. No manual configuration is required. |
When integrating with a custom weapon, ability, or damage system, use these two methods to apply directional force correctly:
// Apply directional damage from a raycast hit
DPT_InteractiveProp prop = hit.collider.GetComponent<DPT_InteractiveProp>();
if (prop != null)
{
prop.TakeDamage(weaponDamage, hit.point);
}
// Open a chest from an interaction prompt
prop.OpenProp();
// Return to pool after destruction
prop.ResetProp();
objectPool.Return(prop.gameObject);
| Method | Use Case |
|---|---|
TakeDamage(float amount, Vector3 hitPoint) | Use when your system tracks health (e.g., weapons, explosions, traps). The prop handles the health check and breaks automatically when the threshold is reached. |
BreakProp(Vector3 hitPoint) | Use when you want to bypass health entirely and destroy the prop instantly with realistic directional debris (e.g., scripted events, cutscenes, or one-hit kill abilities). |
| System Type | Integration Method |
|---|---|
| Custom player controllers | Raycast to find props, call TakeDamage() or OpenProp() directly. |
| Raycast interaction & loot systems | Call any public method on the DPT_InteractiveProp component returned by the raycast hit. |
| Quest & progression / Inventory | Subscribe to On Open Event or On Break Event to trigger item pickup, UI updates, or inventory additions. |
| AI | Use On Break Event to alert nearby AI agents when a prop is destroyed (e.g., heard a noise, investigate position). |
| Object pooling systems | Set Destroy On Cleanup to disabled, then call ResetProp() before returning the object to the pool. |
ResetProp() after any dynamic hierarchy changes to rebuild the cache.This section is for advanced users building their own props from scratch. If you are using the prefabs included with this pack, everything is already assembled correctly and you do not need to read this. If you are importing your own fractured meshes from Blender or another tool, every layer of the hierarchy must be configured correctly for the caching and reset system to work.
| Layer | Required Components | Notes |
|---|---|---|
| Root GameObject | DPT_InteractiveProp, AudioSource |
Add an optional Rigidbody only if the intact prop should physically react before destruction (e.g., tipping barricades, pushable crates). Add an optional LODGroup for LOD-enabled assets. |
| Pristine Visuals Container | MeshFilter, MeshRenderer on each child mesh | All intact visual meshes live here. LOD0, LOD1, and additional LOD meshes belong inside this container. Lids and doors must NOT be placed here. |
| Unbroken Colliders Container | Collider, Rigidbody | If using LODGroups, keep collision geometry separate from visual meshes. For simple props without LODs, the same GameObject can be assigned to both Pristine Meshes and Unbroken Collider Roots. |
| Broken Parent Container | MeshFilter, MeshRenderer, Rigidbody, Collider on every debris piece | Must be disabled in the hierarchy by default. Every debris Rigidbody must start with Is Kinematic enabled. MeshColliders must have Convex enabled - Unity cannot simulate non-convex MeshColliders on dynamic Rigidbodies. |
DPT_InteractiveProp script and an AudioSource.Pristine_Visuals. Place all intact meshes inside it and assign it to the Pristine Meshes array.Unbroken_Colliders. Add fitted colliders and a Rigidbody, then assign it to the Unbroken Collider Roots array.Broken_Parent. Import fractured meshes inside it. Ensure every piece has a Rigidbody (Is Kinematic on), a valid Collider, and Mesh Filter / MeshRenderer.Broken_Parent object in the Hierarchy and assign it to the Broken Parent field in the Inspector.If your project requires external or custom 3D models to be fully integrated into the DPT ecosystem—including custom vertex-data packing, procedural wood grain mapping, normal array configuration, advanced GPU wind system implementation, or any other bespoke features—freelance technical art services are available. Additionally, availability extends to general 3D asset production, high-to-low poly hard surface modeling, stylized prop creation, and game-ready LOD budgeting built to align cleanly with your specific project constraints.