rdInst Tutorial 29 – Destructible Proxies
Last Updated: 2nd September 2024
Tutorial Created using rdInst version 1.43
Download example project (MB, UE5.4.4)
Destructible Proxies are Proxies of either ISM/HISMs or prefabs which swap to a Destructible Geometry Collection Prefab on proximity to an Impulse or Force (client or server multicast) – they can then either swap back to the original, swap to a “destroyed” instance or prefab, or be removed after destruction.
In this tutorial we will create a simple geometry collection for a door, distribute it around the level and give it a destruction proxy.
Step 1. Create a new Project Based on the First Person Template
Create a new project from the FirstPerson template, and tick the “Starter Content” to include that.
Step 2. Create a Geometry Collection for the Door Mesh
Drag a Door Mesh into the level from the StarterContent/Props folder and keep it selected in the level. Then change the Edit mode to “Fracture”
Now click on the +New icon, and select an output name for the geometry collect. Then select the “Uniform” Fracture type, then click the “Fracture Button”.
This creates something like the snapshot below. Once this is created you can go back to “Select” mode to start using the new geometry collection.
To make it easy to shoot, we can turn the glass material opaque to receive hits – just open up the “M_Glass” material in the StarterContent/Materials in the Material Editor and change the material type to “Opaque”.
Now to test it, you can drag the new geometry collection into your level, play and shoot it.
Step 3. Change the Projectile Blueprint code for Proxies
Now open up the BP_FirstPersonProjectile Blueprint in the Blueprint Editor and navigate to the Event Hit in the Event Graph. Add the code as shown below to activate the proxy triggering. The rdProcessImpactProxies node scans through objects close by and swaps in proxies for the ones set up for destructable proxies.
Step 4. Make a larger level
Now expand the play area of the default First-Person level to make room for plenty of destructible doors.
Step 5. Create a new Blueprint Subclassed from rdActor
Now create a new Blueprint subclassed from rdActor, call it BP_DestructableDoor and open it in the Blueprint Editor.
Add a GeometryCollection Component and point it to your newly created one from the previous steps.
Compile and save the Blueprint.
Step 6. Add a rdProcedural Actor to the level and populate
Add a rdProcedural Actor to the level and position/size it to where you want the destructible doors to be placed.
Drag the Original Door Mesh into the “Drag in Meshes” list. A new spawn item will be created in the Object Data section.
Expand the Object Data section, then the SpawnData, then the Items, and Index 0 – at the bottom of that set of data there is a section called “Proxy” – expand that and set the “Proxy Actor” to the BP_DestructableDoor actor created in the previous step. Tick the “Use with Destruction” box.
Above the proxy section you’ll see an option “Place on Ground” – untick that.
Step 7. Set the Collision of the Door Mesh
Now right-click on the SM_Door mesh in the Content Browser and select the “Instance Settings” in the menu – change the collision to Full.
Then open the mesh in the StaticMesh Editor and add a Simple Box Collision to the mesh: