When I enter a vehicle I’m unpossesing a player character and possessing a vehicle. After that i’m calling a player pawn client method to update UI. For some reason on an unpossessed pawn the client method is only called on a server.
To fix that I can first unpossess vehicle, posses player execute client method and then unpossess player and possess vehicle again. But it looks really bad. Is there other way around? Why client methods aren’t working on an unpossessed pawn?
Here is a pseudocode of how it looks now
void AMyVehicle::ServerPlayerEnterVehicle_Implementation()
{
//do something
Controller->Possess(MyCharacter);
MyCharacter->ClientMethodThatUpdatesUI();
Controller->Possess(MyVehicle);
}
Is there a way to call a client method without AController class taking a possession of AMyCharacter?
Found the solution myself. Moved all the UI logic from pawn to player controller that way all the client methods work even if pawn is unpossessed. I don’t know if there is a better solution but moving client methods to the player controller works.