Is it possible to choose a value by the exec output pin?

My blueprint looks something like this (this is just a simplified representation).


Instead of converting the integer value to a float value each time and then making a rotator out of it and finally adding the rotation, would it be possible to just choose one of these values depending on which execute output fires? I was thinking of adding these values to an array and then just fetching them via the “get (a copy)” node, but I think there must be a more elegant solution.

if i understand correctly, i think the select node is what you are looking for.

the determination for what is going to get selected has to be something like bool, int, enum, etc, but that’s probably feasible in most cases.

Select node only has one exec input.

However, you can create a local variable, and use “set” on it for each exec node, and then merge the exec into the Add Relative Rotation, and have that pull from local variable, converted to float, converted to rotator.

Local variables only exist in functions, not event graphs, though. But you should be using functions for almost everything anyway, so that’s fine!

1 Like

Yes, you can use a Switch to do this.

If you right click and create a Switch node you should see this

image

If you select that dropdown Wildcard, you can select what you want your Index variable to be (you can probably also just wire a variable to it and let it figure it out, but i haven’t tried that)

image

So, then instead of using a Branch node above, you can wire your input to the Branch to that Switch

so, if you give a False value to this switch, you’ll end up with 20 on the out side, and if you give a True value to this switch, you’ll have 25 on the out side.

1 Like