UnrealBuildTool confuses "AClass* const" for "const AClass*"

I was trying to add the following function to my class:

UFUNCTION(BlueprintImplementableEvent, Category = "Game")
void RespawnPlayer(AController* const PlayerController);

but compiling failed with the error “RespawnPlayer(const AController*): overloaded member function not found.” You can see it’s looking for a const AController* instead of AController* const. It seems that while generating the code for the blueprint implementation it mixes up the definition.

I can fix this by removing the const which isn’t very important in this scenario, but it’s an annoying error. Are const pointers not allowed in BP?

Hey hdelattre-

You’re correct that const pointers are not supported in blueprints. Pointers to constants objects are allowed, but const pointers are not (“const UObjectType*” is allowed but not “UObjectType* const”).

Cheers