

Transfer the control flow to the execution pin "A" when the value of the internal pin "Switch" is true. Transfer the control flow to the execution pin "B" when the value of the internal pin "Switch" is false.įBlueprintCompiledStatement& GotoStatement = Context.AppendStatementForNode(MyManualSwitchNode) Ĭ(&GotoStatement, BPin) UEdGraphPin* SwitchNet = FEdGraphUtilities::GetNetFromPin(SwitchPin) įBPTerminal* Switch = (SwitchNet) UEdGraphPin* SwitchPin = MyManualSwitchNode->FindPin(SwitchPinName) UEdGraphPin* BPin = MyManualSwitchNode->FindPin(BPinName) UEdGraphPin* APin = MyManualSwitchNode->FindPin(APinName) UK2Node_MyManualSwitch* MyManualSwitchNode = CastChecked(Node) The following is the Blueprint compilation process defined in the member function Compile. To implement this, we define the Blueprint compilation process. If False, execute the node connected to the pin "B". The node "MyManualSwitch" executes the node connected to the pin "A" when the internal pin "Switch" is True. Define the Process of Execution Pinsĭefine the process for the execution pin. Note that we add an internal pin "Switch" that holds a flag to switch the execution pin to execute.īy specifying the value "true" to the member variable DefaultValue, we can set the default value true. SwitchPin->bDefaultValueIsReadOnly = true UEdGraphPin* SwitchPin = CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Boolean, SwitchPinName) CreatePin(EGPD_Input, UEdGraphSchema_K2::PC_Exec, UEdGraphSchema_K2::PN_Execute) ĬreatePin(EGPD_Output, UEdGraphSchema_K2::PC_Exec, APinName) ĬreatePin(EGPD_Output, UEdGraphSchema_K2::PC_Exec, BPinName) We will implement the process of adding pins to AllocateDefaultPins. Pin NameĮxecute the node connected to this pin when the internal pin "Switch" is True.Įxecute the node connected to this pin when the internal pin "Switch" is False.Įxecute the node connected to the execution pin "A" if True.

Add PinsĪdd the following pins to meet the specifications of the node. Steps 1 and 2 are the almost same as in the article for the basic, so we will start from step 3. We can create a Blueprint node by the following steps.
#Blueprint on 3rd menu code
The complete source code is available on GitHub.
