function declaration with the same name with different nb of argument doesn't build


Let say that I want to do in my header file:

FStringAssetReference getDefaultPawn(EName::Type Name);

FStringAssetReference getDefaultPawn(EName::Type Name, uint8 Level);

Here is the error that I have:
1>…MyTest.h(19): error : In MyTest: ‘getDefaultPawn’ conflicts with ‘Function /Script/MyGame.MyTest:getDefaultPawn’

I’m not an expert in C++, but I can’t see what’s wrong in those function definition. They don’t have the same number of parameters. Is it a UE constraint?


I’m pretty sure you can’t overload UFUNCTION() :slight_smile:

If you dont need the UFUNCTION() for any network-code related reason, or for keybinding, I’d just take the UFUNCTION() out and do regular c++ overloading :slight_smile:


This has been confirmed on Answer Hub.

Thanks for the answer.