Multiplayer FPS Gun Position - Local vs Networked Client
Unity 5 with Photon's PUN
I'm stuck on an issue where I run an RPC for a player to pick up a new gun. The RPC function works fine, and it mounts the gun to the player's hand. Looks great to other players. After this I want to run another function locally to then move the gun to be a child of the local player's camera. This is so the local player will see the gun on their screen like you'd imagine in any FPS.
This works fine if the RPC is fired with an PhotonTargets.All
. The problem is I want to do it with PhotonTargets.AllBuffered
so that if a new player joins then they will also see it. Instead, the buffered player they see has the gun mounted to the camera, and basically floating by their head. Once the player is in the game, if someone picks up a new weapon, it works fine.
Am I approaching this from the wrong angle? I have also tried creating a second instance of the gun, mounting that to the local player's camera and then deactivating the held one, but the buffered view of this shows both guns.
Thanks for any help.
Your answer
Follow this Question
Related Questions
How do I sync Rigidbody2D over the network? 0 Answers
[HELP]Player pick-up with Photon 0 Answers
Instantiate with Photon 0 Answers
(photon) weapon switch event is not visible for others (tried rpc) 0 Answers
PhotonMono spawns instead of player. 0 Answers