GetControlledPawn node does not get the player pawn even after call to Possess
Hello. As stated in the question, when I call GetControlledPawn in the player controller blueprint, no pawn is found (I cast it to a pawn derived class and the cast fails; I also print the name of it to the console if the cast fails and it is an empty string). This only happens when in dedicated server as both clients' playercontrollers don't find any controlled panws, or in a listen server where the server finds the pawn but the client doe not. I am prety new to replication and the UE4 networking framework so I assume I am doing something wrong, but I don't know what.
This is the ClientPostLogin, called after from inside the OnPostLogin event in the GameMode.
This is the function called from ClientPostLogin in the PlayerController.
This is the end of the OnPostLogin event in the GameMode. I call RespawnPlayerEvent before the ClientPostLogin.
This is the part of RespawnPlayerEvent that actually spawns the pawns. Note that I possess the pawns right after spawning them.
Turns out that it takes awhile for the possession to happen. I just made the call happen during an event set to a timer. Only when GetControlledPawn returns a valid pawn does the function gets called and the timer is cleared.
answered May 30 '17 at 02:04 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here