Variable Input to Nodes

Recently Epic made a change to variables that allows for an output pin on a variable node. In many cases, this works out to a less cluttered workflow, and in general is really awesome. However, there is a case, and a fairly common one at that, where this just falls short of what is needed.


In the attached screen, what you see is a fairly common scenario. You have a branch, where a variable is altered depending on some condition, and then the variable is returned or used in its new form in some way. In this case, even though the variable nodes have an output pin, this pin is unusable because the return node can only accept one input. Is there a feasible workaround for this? Currently, the only method (that I am aware of) is to set up a local variable, set the variable, and return the variable as in the image above. This creates, as shown, at least three additional nodes and seven links to accomplish what could be achievable with only 4 links.

If you can make Inc Base Focus pure (no execution pins) then you can forgo the branch with a select node. Plug the bool into the bottom of the select node (it’s a wildcard, it can use int, enum or bool) and plug the return value of Inc Base Focus (as a pure function) into option 0 if false and option 1 if true. Then plug the return value of the select node into your return node.

How about something like this?


A simpler approach overall though would not to have both an Inc and Dec function, but rather make that a single function that you pass in a inc/dec boolean.

Edit: Whoops, missed connecting in the condition to the select, but you get the idea hopefully.

You could further simplify this case (assuming IncVal and DecVal do what I assume they do), by just doing Value + Select(Condition, 1, -1).

Michael Noland