0

So here is my issue. I'm trying to create function, which goes on straight away, but also have second exec output, which goes after let's say completing loop.

I tried to make this work with this: thread i googled.

However my issue is when i tried doing it with accepted answer provided i got this error:

E0434   a reference of type "TEnumAsByte<EMyEnum> &" (not const-qualified) cannot be initialized with a value of type "EMyEnum"

Going furthere below there is second answer, which work but it always goes off form last possible pin.In case I show below it always fire "FinishOutput". Is there any way i can force code to output from both pins i provide? Here is how it looks in my code:

.h file

UENUM(BlueprintType)
enum  class EMyEnum : uint8
{
    Output,
    FinishOutput
};

UFUNCTION(BLueprintCallable, Category = "Test", Meta = (ExpandEnumAsExecs = "Branches"))
        static void OutputTest(TEnumAsByte<EMyEnum>& Branches);

.cpp file

void UAudioController::OutputTest(TEnumAsByte<EMyEnum>& Branches)
{
        Branches = EMyEnum::Output;
//some code to execute before second output
        Branches = EMyEnum::FinishOutput;

}
Adrian Rozlach
  • 51
  • 2
  • 12
  • `ExpandEnumAsExecs` picks one output exclusively. Blueprint system checks `Branches` value at the end of C++ function and fires only one output from your BP node. I suggest you: 1) Split your code to two separate nodes and combine them with 'Sequence' Blueprint node or 2) Create dedicated UObject with custom events. You could bind those event in your Blueprint and fire them from C++ one after another. – JKovalsky Apr 21 '17 at 14:55
  • That sounds good to me :3 Gonna try it for sure! – Adrian Rozlach Apr 23 '17 at 11:34

1 Answers1

1

I would make a Macro since it can have multiple Exec outputs. This is in blueprint, not code.

JonS
  • 401
  • 2
  • 5