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?
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
1858: FError::Throwf(TEXT(“‘%s’ conflicts with ‘%s’”), *ThisName.ToString(), *It->GetFullName() );
The HeaderParser iterates trough all known function names before adding a new function to the unreal functions list, throwing this if there is one with the same name, no matter what the parameters are.
So it is not possible to have two UFUNCTIONS with the same name in the same class.
But you can still go the way I prefer and do this: