Attack shockwave system

Fairly straightforward and a few ways to do it. Using a mesh collider of any shape and checking what it is overlapping is the most straightforward way.

Here's a super short breakdown:

  • Create a new Blueprint Actor called "Shockwave" and add a scene component as its root.

    • Add a Static Mesh component as a child of the root, using a ring mesh for the shockwave (create your own or find one in the marketplace). Make sure its collision settings are set to overlap without blocking the player Pawn. You can also add other visuals here, but they should have no collision responses of any kind.
      • Make sure it has a collision setup that works (overlap but no blocking of the player Pawn)
      • Make sure it has overlap detection on
    • In the Shockwave's Event Graph, add an Event Begin Play node, and create a Timeline node with a float track to control the scale of the ring mesh over time. Set the timeline to start on Begin Play.
      • Connect the Timeline's Update output to a Set World Scale 3D node, multiplying the float output by a vector (e.g., 1,1,1) to scale the ring mesh uniformly.
    • Create a custom event called "DetectPlayer" and bind it to a Set Timer by Event node with a looping time interval (e.g., 0.1 seconds). Tthis is a much more optimized way of doing a Tick - you should not use event ticks unless absolutely necessary.
      • In the DetectPlayer event, use the Get Overlapping Actors node on the Static Mesh component to get all overlapping actors. Iterate over the actors using a ForEachLoop node.
      • Inside the loop, use a Cast To node or an Interface check to determine if the overlapping actor is the player or another actor that should take damage.
      • If the overlapping actor is the player or a damageable actor, apply damage using your game's damage system (e.g., call a custom event for damage in the player character or interface function).
    • When the timeline finishes, use the Event Timeline Finished node to destroy the Shockwave actor and perform any required cleanup.

    In the combat scenario, boss fight, or other gameplay event where the ground slam occurs, spawn the Shockwave actor at the location of the enemy performing the slam when the animation reaches its peak. The Shockwave actor will handle the rest of the process.

/r/unrealengine Thread