Unity Photon Transform View Issues

Options
Hi, so I'm fairly new to using Photon Networking and multiplayer in Unity and I've been stuck with an issue for a few weeks that I can't seem to fix. I have a game where you select a player and it instantiates a certain prefab determining on the player you selected and loads a new scene with the help of some tutorials I found on YouTube. The problem is with my photon view's and my photon transform view's I think or possibly my movement script. What happens is, I start the game and load in one player and everything works fine. Then when I open a second build, all of a sudden one build can control both characters, and the other build can't control anything. I have photon views and transform views on all of my prefabs and have been lost trying to fix this issue forever. Also none of the movement seem to be synchronized across the game as I might move the characters left on one build and they will not move on the second. I don't know if anyone has any clues on how to fix this but I would be more than happy to answer any questions if anyone knows a possible solution. Here is what I thought I was supposed to be doing for the movement code - private void FixedUpdate() { if(PV.IsMine) { ApplyMovement(); CheckSurrondings(); } }

Any help would be massively appreciated.

Comments

  • trik
    Options
    so i encountered a similar Problem today. For me the cameras where on the wrong Players and the Inputs too. I managed to fix it by disabling all cameras in the PlayerScript with the exception of the one that my pv.IsMine uses.
    I hope this might help you even if its a little different.
  • BenBonk
    Options
    Thanks for the reply. How did you manage to do this? Did you add a photon view to your camera or something like that? I'm still trying to figure out how Photon works.
  • sierra
    Options
    Bump

    I also need a solution for this. Anyone got a solution?
  • Federico123
    Options
    You might need to do a code that deactivates the scripts and gameobjects if you get that error.
    I reccomend to do this: make 2 scripts, one that does player remote movement (so if game objects are disabled, this script must make smooth movement for the players in game) and one that deactivates local scripts and remote scripts (with local i mean if you have a player model, you should do that local player doesnt see it, and if your player has a name script, it should be disabled so local player cannot see it, and with remote you should do that you can disable player script the one where they look around and move, not the player remote movement, and remote should disable camera view), i have done that too.