Hi,
I try to move the player specifics stuff to my PlayerController, but I have some trouble.
After possessing a pawn, I should be able to add and initialize a widget (through a blueprint call) and set a camera.
First, I tried this:
void AMyPlayerController::Possess(APawn* aPawn)
{
APlayerController::Possess(aPawn);
FollowCamera->AttachTo(OwnedShCharacter->GetCameraBoom(), USpringArmComponent::SocketName);
FollowCamera->bUsePawnControlRotation = false;
SetViewTarget(this);
BPAfterPossessEvent();
}
(OwnedShCharacter is initialized at BeginPlayingState(), which is called before APlayerController::Possess() ends.)
But the client will never run the Possess function at all. I also tried BeginPlayingState(). It did not have a valid character reference there.
I could not find a function which would be called on client after the effect of the Possession is replicated - it has to have a valid reference to the character in order to setup things. Is there any function like that?
Thanks for reading,
Elathan