Announcement

Collapse
No announcement yet.

Damageable Static Mesh

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Damageable Static Mesh

    Similar to how a vehicle switches meshes when it takes enough damage and explodes, is there a built in feature for static meshes or is it a matter of stripping down the turret/vehicle code? I'm just doing some tests so it doesn't have to be perfect but as long as I get the desired effect.

    Can someone point me in the right direction? =)

    #2
    I'm not sure how to do it in the actual code, but I know of a quick way to do it in kismet:

    drag the static mesh you want to "explode" into your scene, right click it, and choose convert then convert it to a mover. Place an explosion particle effect of your choice on the mesh as well.

    Now select the mesh and open Kismet. Right click and choose "new event using interpactor_Whatever and choose "Take Damage" Set the instigator to all players, and set the damage taken number to the amount of damage you want it to take before it will explode. Now right click an empty space, and choose "New Action" -> "Actor" -> "Set Mesh" and connect the Out of the Take Damage Event to the In on the set mesh node. Set the target as the interp actor mesh. Click on the Set Mesh node and change the mesh type to "MeshType_StaticMesh" and select the destroyed mesh in the content browser that you want to show up when it exlodes, and click the green arrow in the Set Mesh node for New Static Mesh.


    You should also create a level loaded event and use an Attach to actor node to attach the explosion particle effect to the original mesh, and use a toggle to have the particle effect set to OFF on level loaded as well, then use the take damage event to toggle it on. You can also add a sound as well.

    Here's the setup I used in Kismet:

    Comment


      #3
      Also, make sure the pivot points match up for both meshes since the new mesh will spawn with its pivot point where the old mesh's pivot is located.

      Comment


        #4
        That's a quite nice work around. I'm not too fussed about the actual explosion, it's the mesh replacement I'm looking for so that helps loads. =) Cheers.

        Comment


          #5
          Glad it helped!

          Comment

          Working...
          X