I am trying to replicate a controller possessing a pawn to all clients.
Here is how I think it should be, in my case a character entering a vehicle
- Character sends input to enter -
- Server decides if player can enter vehicle
- Server executes possessing
This works, but I have a debug line above the vehicle stating the owner of the vehicle. It would make sense that all clients are aware of the owner of the vehicle right?
What is happening is that the driver and server are aware of the owner of the car, but anybody else sees it as no owner. I’m trying to figure out the best way to make other clients aware of the owner. Any help would be appreciated.
A bug was recently fixed in pawn.cpp that would cause issues with changing possession. Make sure you have this in your version of pawn.cpp:
void APawn::GetLifetimeReplicatedProps( TArray< FLifetimeProperty > & OutLifetimeProps ) const
Super::GetLifetimeReplicatedProps( OutLifetimeProps );
DOREPLIFETIME( APawn, PlayerState );
DOREPLIFETIME( APawn, Controller ); <-- Here
DOREPLIFETIME_CONDITION( APawn, RemoteViewPitch, COND_SkipOwner );
You want to make sure Controller is not using a condition. I think this was fixed in 4.4, and if not it will be in 4.5 for sure!
oh i have similar error when enter vehicle and exit it will restart level, something related to controller in vehicle, but i only submit error before releasing 4.4 a few day, so they said the fix will be in 4.5.
As of today Sept 22 this didn’t seem to be fixed in the GitHub code for 4.4.