How to reduce repetition setting variable values from multiple paths?

Hi, brand new to unreal development so this is very basic I’m sure. I couldn’t find an answer online or in thsi forum so sorry if the answer is here already. Basically I’ve created an attack flow in my character blueprint. i wanted to reuse the attack function for various attack types and then use variables to determine the different thigns such as reach and attach power etc.

My issue is the setters at the beggining. I’m duplicating the setters for each attack type which will obviously get worse as I add different attack types. How can I have 1 line of setters here and depending on which enumerator was used to call them (e.g. which attack type) set the values differently?

A screenshot is below. Thanks for any guidance.

Hey! Doing it this way will definitely make your graph hard to manage later. Here are 3 ways to optimize this, from simple to professional:

  1. The “Select” Node (Easiest): You don’t need multiple execution lines. Use only one Set node for each variable (e.g., Attack Power). In the input pin of that Set node, plug in a Select node. Connect your E_AttackType to the Select node — it will automatically create pins for “Punch” and “Kick”. Now you can just type the values directly there.

  2. Using a Struct: Create a User Defined Structure with all your parameters (Power, Distance, Height). In your Blueprint, you can use a single Select node to switch between two versions of this entire Structure. This keeps your graph super clean with only one “Set” node for everything.

  3. Data Tables (The Pro Way): If you plan to add 10+ attack types, use a Data Table / create a Struct first, then create a Data Table based on it. You can fill in all the numbers there like in Excel. In your Blueprint, just use the “Get Data Table Row” node and pass your Enum as the Row Name. This way, you don’t have any hardcoded numbers in your logic at all!

Method #1 is a quick fix, but #3 is what people use in real production. Good luck!