Developer Notes

This issue has been closed as 'Won't Fix' due to an extended period of time without updates. If this issue is important to you please let us know by posting on the AnswerHub or UDN, and Epic will re-open the ticket for further review.

Description

Giving an int32 variable the specific ArrayClamp has no affect when the specified array is defined inside a USTRUCT(). Variable is able to be set to a value outside of specified struct's range.

Steps to Reproduce
  1. Open UE4 Editor
  2. Add code to project based on Actor (MyActor)
  3. Add the following to MyActor.h
    • Above the UCLASS specifier
      USTRUCT()
      struct FRandoStruct
      {
      	GENERATED_BODY()
      		UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      		TArray<float> FloatArray;
      
      	FRandoStruct()
      	{
      		FloatArray.Add(423424);
      		FloatArray.Add(23432);
      		FloatArray.Add(3434);
      		FloatArray.Add(4578);
      		FloatArray.Add(459879);
      		FloatArray.Add(458);
      	}
      };
      
    • Add to class definition
      	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      		TArray<int32> ClassArray;
      
      	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test, meta = (ArrayClamp = FloatArray))
      		int32 ClassArrayRef;
      
      	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test, meta = (ArrayClamp = IntArray))
      		int32 StructArrayRef;
      
      	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
      		FRandoStruct StructRef;
      
  4. Add the following to MyActor.cpp inside constructor
    	ClassArray.Add(423424);
    	ClassArray.Add(23432);
    	ClassArray.Add(3434);
    	ClassArray.Add(4578);
    	ClassArray.Add(459879);
    	ClassArray.Add(458);
    	ClassArray.Add(23);
    
  5. Compile
  6. Create a blueprint based on MyActor (MyActorBP)
  7. In the Details panel, enter a value of 100 into "Class Array Ref" and "Struct Array Ref" fields

Result:
Class Array Ref field will reset to 6 upon Enter but Struct Array Ref field will remain at 100

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

2
Login to Vote

Won't Fix
ComponentUE - Gameplay - Blueprint
Affects Versions4.13
CreatedSep 14, 2016
ResolvedMar 26, 2018
UpdatedMar 26, 2018