playMaker

Author Topic: Photon PUN 2 bug? (GetIsMine)  (Read 2186 times)

demonata08

  • Playmaker Newbie
  • *
  • Posts: 4
Photon PUN 2 bug? (GetIsMine)
« on: October 08, 2019, 09:41:15 PM »
So this issue has gotten my head hurting pretty bad. Its possible im doing something wrong here. But im using instantiate to spawn in my player. Then im using the "Photon View Get Is Mine" and it always responds with a false. No matter the situation. I've tried it in every way i can imagine. With or without instantiate. Spawning the object in myself and all.

I can only imagine its either a bug or im using it wrong. I cant find much documentation on the tools anymore and the demos are outdated and wont load on current unity. If anyone knows anything i would really appreciate a push in the right direction

demonata08

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #1 on: October 08, 2019, 11:35:48 PM »
Just gonna post my own solution here. I sunk my entire day into this issue and after posting i came across the photon website and was looking through it. i noticed it said that the command "get is mine" will not work if the room doesnt load before calling it. and it appears my project was loading the instantiate just ever so faster then it was following through with the joining room command.

The fix was to just call the instantiate command on the join room event. Which in hindsight. makes perfect sense. Ah well. Hopefully someone else may benefit from my stupidity :/

thanks anyway forum.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #2 on: October 09, 2019, 01:54:47 AM »
Hi,

 Is mine only make sense when you are inside a room, because this is the only time where you can potentially be with other players...

I'll put an error log in the console within that action if I detect this case, so that at least you don't waste time wondering why it doesn't work.

Bye,

 Jean

demonata08

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #3 on: October 09, 2019, 01:39:54 PM »
Hi,

 Is mine only make sense when you are inside a room, because this is the only time where you can potentially be with other players...

I'll put an error log in the console within that action if I detect this case, so that at least you don't waste time wondering why it doesn't work.

Bye,

 Jean

Yeah, I suppose so.

So, real quick. Using the photon tab on play maker component -> Add photon ready fsm to object is returning the error

InvalidOperationException: Collection was modified; enumeration operation may not execute.

It returns that whether i have anything actually in the FSM or not. Any idea on that? thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #4 on: October 11, 2019, 03:14:10 AM »
Hi,

 I can't repro this. what kind of object are you selecting before executing " Add photon ready fsm to object"

 can you maybe make a screencast or something? I am likely missing an important step to repro this.

Bye,

 Jean

demonata08

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #5 on: October 11, 2019, 12:19:47 PM »
Hi,

 I can't repro this. what kind of object are you selecting before executing " Add photon ready fsm to object"

 can you maybe make a screencast or something? I am likely missing an important step to repro this.

Bye,

 Jean

Yeah so its very possible im not using it correctly as i cant find anything on how to use it. But i do believe i am using it correctly based on a few youtube videos of other people using it.

Gonna go ahead and apologize for the poor image quality. im capturing a 32:1 monitor. change it to 1080p and full screen and you should be able to see it just fine.


It throws the following error regardless of if im in a room in multiplayer or not. whether there are any variables to sync or not.  even if its just an empty game object with nothing on it. I believe that makes it impossible to sync variables across clients.


Code: [Select]
InvalidOperationException: Collection was modified; enumeration operation may not execute.
System.ThrowHelper.ThrowInvalidOperationException (System.ExceptionResource resource) (at <599589bf4ce248909b8a14cbe4a2034e>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNextRare () (at <599589bf4ce248909b8a14cbe4a2034e>:0)
System.Collections.Generic.List`1+Enumerator[T].MoveNext () (at <599589bf4ce248909b8a14cbe4a2034e>:0)
HutongGames.PlayMaker.Pun2.PlayMakerPhotonProxy.SanitizeGameObject (UnityEngine.GameObject go) (at Assets/PlayMaker PUN 2/Scripts/PlayMakerPhotonProxy.cs:219)
HutongGames.PlayMaker.Pun2.PlayMakerPhotonGameObjectProxy.Awake () (at Assets/PlayMaker PUN 2/Scripts/PlayMakerPhotonGameObjectProxy.cs:71)
UnityEngine.GameObject:SetActive(Boolean)
HutongGames.PlayMaker.Actions.ActivateGameObject:SetActiveRecursively(GameObject, Boolean) (at Assets/PlayMaker/Actions/GameObject/ActivateGameObject.cs:117)
HutongGames.PlayMaker.Actions.ActivateGameObject:DoActivateGameObject() (at Assets/PlayMaker/Actions/GameObject/ActivateGameObject.cs:99)
HutongGames.PlayMaker.Actions.ActivateGameObject:OnEnter() (at Assets/PlayMaker/Actions/GameObject/ActivateGameObject.cs:43)
HutongGames.PlayMaker.FsmState:ActivateActions(Int32) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:205)
HutongGames.PlayMaker.FsmState:OnEnter() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:175)
HutongGames.PlayMaker.Fsm:EnterState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2771)
HutongGames.PlayMaker.Fsm:SwitchState(FsmState) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2718)
HutongGames.PlayMaker.Fsm:UpdateStateChanges() (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2643)
HutongGames.PlayMaker.Fsm:DoTransition(FsmTransition, Boolean) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2685)
HutongGames.PlayMaker.Fsm:ProcessEvent(FsmEvent, FsmEventData) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2253)
PlayMakerFSM:BroadcastEvent(FsmEvent) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:786)
PlayMakerFSM:BroadcastEvent(String) (at C:/Projects/Playmaker_1.9.0/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:769)
HutongGames.PlayMaker.Pun2.PlayMakerPunCallbacksProxy:BroadcastCallback() (at Assets/PlayMaker PUN 2/Scripts/PlayMakerPunCallbacksProxy.cs:181)
HutongGames.PlayMaker.Pun2.PlayMakerPunCallbacksProxy:OnJoinedRoom() (at Assets/PlayMaker PUN 2/Scripts/PlayMakerPunCallbacksProxy.cs:309)
Photon.Realtime.MatchMakingCallbacksContainer:OnJoinedRoom() (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:3495)
Photon.Realtime.LoadBalancingClient:OnEvent(EventData) (at Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs:2677)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(StreamBuffer) (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PeerBase.cs:640)
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/EnetPeer.cs:552)
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands() (at C:/Dev/photon-sdk-dotnet/PhotonDotnet/PhotonPeer.cs:1548)
Photon.Pun.PhotonHandler:Dispatch() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:205)
Photon.Pun.PhotonHandler:FixedUpdate() (at Assets/Photon/PhotonUnityNetworking/Code/PhotonHandler.cs:139)
« Last Edit: October 11, 2019, 12:24:29 PM by demonata08 »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon PUN 2 bug? (GetIsMine)
« Reply #6 on: October 14, 2019, 03:02:19 AM »
Hi,

 We are deviating from the original issue now. so I assume the getismine is now sorted right?

but, your video helped me understand the issue, and it's fixed, can you updated from the ecosystem and let me know if it works now?

BYe,

 Jean