So I am still learning C++ but been using it for quite a while. But I have a function which is not working properly (separate question posted here: Calling Client RPC in order to assign a Team value to clients. How to check the Role properly? - Development Discussion / Multiplayer & Networking - Unreal Engine Forums).
I am starting to think the problem MIGHT be about how I cast from the APawn* to APlayerMallet* (which is actually extending ACharacter not APawn).
APlayerMallet* mallet=(APlayerMallet*)gamestate->PlayerArray[i]->GetPawn();
The code compiles and it does find the function in APlayerMallet if I change the IF statement to force it to call the function in APlayerMallet.
I suppose here I am just looking for confirmation that it is ok to do such a cast.
Thank you for any help