Here’s the code:
UCLASS(BlueprintType)
class TESTS_API UVectorProperty : public UVectorBaseProperty
{
GENERATED_BODY()
public:
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VectorProperty")
FVector Location;
UFUNCTION(BlueprintPure, Category = "VectorProperty", Meta = (CompactNodeTitle = "Vector", DisplayName = "Create Vector Property", HidePin = "Property"))
static UVectorProperty* Create(FVector Location, UVectorProperty* Property = nullptr);
UFUNCTION(BlueprintPure, Category = "VectorProperty")
virtual FVector GetValue() const override { return Location; };
};
and here’s the error:
2> Running UnrealHeaderTool "E:\Unreal Projects\Tests\Tests.uproject" "E:\Unreal Projects\Tests\Intermediate\Build\Win64\TestsEditor\Development\UnrealHeaderTool.manifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed
2> E:/Unreal Projects/Tests/Source/Tests/Debug/DebugVisualiserProperties.h(46) : Function parameter: 'Location' cannot be defined in 'Create' as it is already defined in scope 'VectorProperty' (shadowing is not allowed)
If I understand this correctly, it seems like the compiler won’t allow this because it thinks that the FVector Location parameter will hide the Location member.
Correct me if I’m wrong, but seeing as Create is static and Location is not, the two of them cannot clash in any way.