This will compile:
UFUNCTION(BlueprintCallable, Category = "timstuff")
void SetMover(UCOMP_Mover* Mover);
UPROPERTY(EditAnywhere, Category = "timstuff")
UCOMP_Mover* Mover;
Where as the following will not:
UPROPERTY(EditAnywhere, Category = "timstuff")
UCOMP_Mover* Mover;
UFUNCTION(BlueprintCallable, Category = "timstuff")
void SetMover(UCOMP_Mover* Mover);
Visual Studio Community Edition 2022 throws an error and wont compile:
Severity Code Description Project File Line Suppression State
Error Function parameter: 'Mover' cannot be defined in 'SetMover' as it is already defined in scope 'ObjectProperty /Script/CryptEscape.TriggerComponent:Mover' (shadowing is not allowed) CryptEscape M:\UnrealEngineProjects\CryptEscape\Source\CryptEscape\TriggerComponent.h 43
Google says:
https://www.learncpp.com/cpp-tutorial/variable-shadowing-name-hiding/
This feels to me like something that should either be addressed in this video or perhaps we should not use shadowing.
I’ve never encountered this error before so I might be misunderstanding the issue a little.