Problem in SetViewTargetWithBlend in Multiplayer

i’m trying to make a sky camera for all players then when the match starts each playerController switch to his own pawn’s camera with blend (SetViewTargetWithBlend) and possess his own pawn

1st: I have set a reference to the player pawn in the playercontroller, this reference is set by game mode (by server) and is replicated too, the player is now possessing the sky camera

2nd: when the match starts the gamemode calls each player controller in the lobby to start the event of switching view
from the sky camera to the pawn camera

3rd: The event which does the switch view is on each player controller and it’s (Run on owning Client) and it does the following as the BP shows, also possess in the player pawn

However, only the host server does the switch camera view and the client doesn’t, and an error message is shown (Pawn not valid), tho it’s replicated and set by the gamemode(server)

can some1 pls help me with that i can’t find where’s the problem cuz every thing seems ok

1 Like

Ok i found the Solution, it’s something related to ownership of the pawn…
it’s currently spawned by gamemode so it’s owned by the server, thus my connection to it is dropped when using client RPC

the solution is determine the owner of the pawn when the game mode is spawning it in first place by (plugging the owner node -in the spawn actor from class- to the player controller reference so u can have access to it now

Or When u spawn an Actor by the server, u can Set Owner node to this actor to be it’s player controller

1 Like