Owner scene not changing to takeover but staying as fixed.

Options
Hello, I'm having an issue when I come into my scene from another scene my photon view owner changes from takeover to fixed which is causing an issue with communication between multiple connections so its not sending the RPC. If i start the same scene as the photon view being takeover, it will stay as a takeover. But once I go from say the menu scene into the game scene the photon view goes back to fixed.

Is there any way to fix this because with the photon view going back to fixed it seems to be causing a communication issue between the players and prevents everyone but the master from communicating. If you need a scenario let me know and I can post some screenshots with some more explanation.

Thank you
Dave

Comments

  • Tobias
    Options
    So, the ownership setting resets to "fixed" in objects loaded with the scene, when you load a scene at runtime?
    We have to take a look.
  • Tobias
    Options
    I can't reproduce this in PUN v1.70 in a Unity 4.7.1 version. I'm joining a room and loading a scene with a networked GO but the ownership setting stays the way I set it.
    If you're not using PUN v.170, please update. You might want to open the scenes and save them again. In doubt, you might check if the .meta file (in text mode) contains the correct setting you expect.

    Let us know which Unity version you use.
  • Onyxius
    Onyxius
    edited June 2016
    Options
    Thank you, so even if i open the game scene, change teh photon view to takeover, save scene, save project, close Unity. Then open unity back up and go into the game scene it is back to fixed and not takeover. Which .meta file should I be looking in. I looked at several and they have pretty much the same settings.

    Also, I am updated to 1.70
  • Onyxius
    Options
    Here is a warning that comes up, not sure if it helps:
    Ownership mode == fixed. Ignoring request.
    UnityEngine.Debug:LogWarning(Object)
    NetworkingPeer:OnEvent(EventData) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1914)
    ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)



    Then the .meta for the photonhandler is this:
    fileFormatVersion: 2
    guid: (random letters and numbers)
    labels:
    - ExitGames
    - PUN
    - Photon
    - Networking
    MonoImporter:
    serializedVersion: 2
    defaultReferences: []
    executionOrder: 0
    icon: {instanceID: 0}
  • Onyxius
    Onyxius
    edited June 2016
    Options
    Now i feel silly, several times i looked over the code and didnt see the issue until now. photonView.RPC("P2Ready", PhotonTargets.All); was set to P1Ready instead of P2Ready :(

    So if i'm understanding it correctly, because it kept sending p1 ready as player 2. Not sure how that fixed the owner issue of staying on fixed instead of takeover.
    Thank you so much, now to tackle the chat issue which i think is just me missing custom code.
    
    	public void Ready() {
    		if (p1) {
    			this.photonView.RequestOwnership();
    			photonView.RPC("P1Ready", PhotonTargets.All);
    		}
    		if (p2) {
    			this.photonView.RequestOwnership();
    			photonView.RPC("P2Ready", PhotonTargets.All);
    		}
    	}
  • Tobias
    Tobias admin
    edited June 2016
    Options
    The sender of a RPC is also in the Photon Message Info. You don't need to send separate RPCs to implement this (in fact: you should not do that).

    Good to read you could find and fix this.