Hello, I ran in to a problem where I wanted to create a lock pick system and I used sub level to create a new level and spawn the lock picking in to there. The problem is that Whenever I possess the lock pick with server it works fine, but with the client, only the widget appears and client is not being possessed by the pawn. I tried to multiple methods to fix this, but nothing has worked. Any help is highly appreciated. Thanks!
Which object holds this blueprint?
Level blueprint
Ok. Since possession is the problem you need to provide more information about that.
The only thing I see is Server Possess Pawn and although I can’t tell what it does I can assure you it will never run on the client.
Notice the last line of title of the node says Replicates To Server (if owning client)… The client does not own the level so this event is not called at all on clients. The client owns their controller and their controlled pawn. Only from there you can call events replicated to the server.
But how would I get the client’s controller and pawn? Can’t I get them for the level blueprint?
Yes you can get the player controller or pawn from almost anywhere with these nodes:
However the server event should also be implemented there (in the pawn or the controler) in order for the client to call the server.
To be franc, I rarely see any blueprints in the Level BP. Maybe you should reconsider where your logic is happening. Now I don’t actually know your setup but I don’t think changing the player pawn should be responsibility of the level.
Edit: Oh and we were talking about multiplayer so the nodes in the screenshot will always return the first player. (with index 0) If you want it to work in mp (as I assume from your server events) you’ll have to send a reference of the actual player that has interacted with the lockpick.