I am using 4.25.4.
Steps:
-
Create a blank new c++ project
-
Add a new c++ class inheriting from pawn
-
Add a new c++ class inheriting from pawn
-
Create a new function with specifiers BlueprintCallable and meta = (AutoCreateRefTerm = “Arg1, Arg2…”) and add some default values for arguments for this function
UFUNCTION(BlueprintCallable, meta = (AutoCreateRefTerm = "Arg1, Arg2"))
void Test(const int32& Arg1, const int32& Arg2 = 1);
- Add something to print those values
void AMyPawn::Test(const int32& Arg1, const int32& Arg2)
{
GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Cyan, FString::Printf(TEXT("Arg1: %i, Arg2: %i"), Arg1, Arg2));
}
- Create blueprint class inheriting from pawn that you’ve created
Screenshot - Call the function you created without changing the values of the arguments
- The arguments passed will always be 0
Screenshot