Branch node in Blueprint has option to "do nothing" with true/false path, how to implement this in c++?

the function is:

bool function(value)
{
  if value == false
    {
      return false;
    } else {
      do nothing;
    }
}

of course this is buggy. you must cover every control paths to return a bool. cant figure out how to do it in code.

1 Like

You just don’t implement it. The C++ equivalent of the above BP is:

...
if (!Condition)
{
    return Active;
}
1 Like

Evil, I understand your point, but perhaps there is a need for a truly dead, do nothing, node? I’m trying to create a minimal blueprint to determine if two keys are pressed (Left Control and Q).

Without that fake “Do Nothing” print statement, the editor trims away the whole Q key pressed branch. Specifically, the compiler reports: Q was pruned because its Exec pin is not connected, the connected value is not available and will instead be read as default.

But I’m just learning this stuff… other ideas here?

Followup. At least for my use case (two keys pushed at the same time), I found a much better way. Less is more. Note the Details tab and Modifier entries on the right hand column.