Download

I want a "static" mesh that can change to a different static mesh through code.

What I would like to do is damage a wall, and when the wall is destroyed, replace it with another mesh. What’s the best way to go about doing that? It doesn’t have to actually take damage like destructible mesh. Thanks for your help!

I have this code which I remember working



Begin Object Class=StaticMeshComponent Name=defmainmesh
StaticMesh=StaticMesh'test.testmesh'
Scale=3.0;
CollideActors=false
BlockActors=false
End Object
Components.Add(defmainmesh)
mainmesh = defmainmesh;


function Config(StaticMesh meshname)
{
mainmesh.SetStaticMesh(meshname);
}



Another thing I do when dealing with more complex stuff, is to have 2 objects at the same location and use SetHidden to show/hide either one or the other, that’s when the objects have very complex behaviors that I can’t just change by running one line of code.

I have done fractured meshes on my game, and for me it works perfectly.

You don’t need in example that the player actually shoots, hits the wall, just place a RB_RadialImpulseActor to the map and trigger it via kismet, and it will cause the hit and destroy the wall.

Also you can add a particle effect in the front of the wall and trigger it to simulate an explosion.

If you need that the player can pass through the destroyed wall after the “explosion”, you need to place a blocking volume behind the fractured mesh (because it does not block collision) and whenever the wall is destroyed by the RadialImpulseActor you destroy the blocking volume. I have done all this in kismet.

Good luck :smiley:

Thanks ciox and udkultimate. I’ll give both of those a try and see which works for me.

For using RadialImpulseActor just take a look on the UDK ExampleMap.udk, that one which is in a kind of hangar, where you get an elevator then place a bomb on wall to open the passage to a small room where you fight a boss (bot).

Is from that map I got the fracture mesh idea: