Blueprint MakeArray Structure Pins

  1. Use a MakeArray Node with Structure pins
  2. “Split Struct Pin”
  3. “Remove array element pin”
  4. Newer pins added are either -1 or some other number

To prevent the bug at Step 4, you must “Recombine Struct Pin” before Step 3. Otherwise, once it happens you must delete the MakeArray node and start over.

I used a C++ class:

USTRUCT(BlueprintType)
struct FActorStateTransition
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(BlueprintReadWrite)
	int32 State;
    UPROPERTY(BlueprintReadWrite)
	int32 OtherMember1;
    UPROPERTY(BlueprintReadWrite)
	int32 OtherMember2;
};

UCLASS(Blueprintable)
class CELESTIAL_API UActorStates : public UObject
{
	GENERATED_BODY()

	UFUNCTION(BlueprintCallable, Category=States)
	void AddStates(TArray<FActorState> States) {}
};

And then to reproduce the bug:

  1. Parent a Blueprint class to ActorStates
  2. Create the “AddStates” function node (Right-click Graph → States → Add States)
  3. Drag out the “States” input and “Make Array”
  4. Right-click on [0] and “Split Struct Pin”
  5. Right-click on the top [0] member and “Remove array element from pin”
  6. The other members are still there (which shouldn’t be)
  7. Newer pins (“Add Pin”) added are either -1 or some other number

Hey joe.ds-

Could you elaborate on your reproduction steps? The first step is to create a Make Array node and feed a struct into the input ( [0] ), correct? What do you mean in your second step by “Split Struct Pin”? Following the three steps at the bottom of your post, what is supposed to happen after adding the Make Array node from the States array?

Cheers

I added the complete list at the bottom. Sorry for the confusion, I was only trying to describe the bug at the top.

Hey joe.de-

I did not see any negative numbers however I was able to reproduce similar behavior with array element numbers changing when an element pin is removed. This has been reported for further investigation (UE-21392).

Cheers