Search Unity

  1. New Unity Live Help updates. Check them out here!

    Dismiss Notice

Photon Unity Networking

Discussion in 'Connected Games' started by tobiass, Aug 23, 2011.

  1. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
  2. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    360
    Hi,

    yes, it's possible. For this kind of discussion it's best to go to photon forum and create a new thread : https://forum.photonengine.com/categories/unity-networking-plugin-pun

    the complexity is not when you already play, we have a team utility script to handle this case ( and a new version of this script is coming up likely in the next update of pun as well :) )

    It's how to set it up and have all players to decide which team they will be with etc, so you have several aspect to consider:

    -- friendlist
    there are some documentation on this https://doc.photonengine.com/en-us/pun/v2/lobby-and-matchmaking/userids-and-friends

    this is important as it will allow players to find each other quickly.

    -- teaming up
    one very powerful way is to use pun chat sdk to let all your players communicate in and out of rooms ( something pun itself doesn't allow), this way you can create teams, have everyone agree to start the game.
    once team are decided, one of the player will be elected as the one to create the room, all other players will simply wait and for that room to be created, and join when it is. they can be inform either via the friendlist, or via the chat sdk. The chat sdk is powerful because it can do more than simply chat, you can communicate between clients without the user having to take part of it, so the whole room creation process and all other players having to wait and join can be automated this way.

    -- in game

    the first thing is to assign each player to the right team ( using the utility script we provide or simply setting it up via room and players custom properties). then the game can start.

    Also, you don't need to purchase anything, start with the free pun version, it will be enough to develop the game.

    Let me know if you have more questions.

    Bye,

    Jean
     
  3. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    360
    Hi,

    Please check the basic tutorial to learn how to use custom stream of data. https://doc.photonengine.com/en-us/...rial/player-networking#health_synchronization

    basically, you need to write your data the same way you are going to read it, and for this you do in sequence several calls to .SendNext() when writing, and .ReceiveNext() when reading. that's all there is to it.

    Bye,

    Jean
     
  4. bharath09vadde

    bharath09vadde

    Joined:
    Nov 23, 2017
    Posts:
    8
    Hello @tobiass
    I am creating an application in which I would like to send my camera position with respect to an object called "Base" and the other person joined the network should get this value and sync with respect to the "base" object in his game so that the position and rotation are both in sync. Can anybody direct me to achieve this task?
    PS: I am new to Photon PUN but have been working on it for the past few days.
    Thanks in advance.
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    If I understand you right, you should be able to do that by coming up with a customized PhotonTransformView with some offset (base).
    If the base does not change, you could hardcode it per scene. Or if it does change and if every player may have her own base, then assign IDs per base and use Player Properties to sync the base ID.
    Also see:
    https://doc.photonengine.com/en-us/pun/v2/connection-and-authentication/regions
     
  6. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    708
    Can I use this for support? I'm using playmaker and cant even connect to master. Seems like all settings are correct and I'm using
    Connect to best server
    . Full log is enabled but all I get is "Region Pinging Result: ru[5.188.170.5:4530]: 24ms"

    No attempts to actually connect and no errors are displayed which makes it pretty much impossible to see whats wrong. Are there more detailed clients logs somewhere? What am I doing wrong?

    I need to connect to the cloud.

    My settings:

    upload_2019-11-22_19-33-31.png

    EDIT: Oops, I enabled full Pun logging not full network logging. Reading the logs now.

    It looks like Playmaker plugin issue. The logs say I'm connected but I never get the callback.

    upload_2019-11-22_19-37-54.png

    I think I'm missing some scripts that are supposed to send playmaker event callbacks.. But I'm not sure. More likely that the system responsible for callbacks is initialized when I connect, so it should work.

    But it doesn't work. I get no callback events. Please help.

    EDIT: SOLVED!

    I found the prefab I needed to drop into the scene to have PUN-Playmaker integration working.
     
    Last edited: Nov 22, 2019
  7. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    So I switched to this after the UNet deprecation and must say I've fallen in love with most of what I've found with Pun2 despite some issues here and there. I even went as far as buying another person's asset to help with sync'ing my objects to help speed up my process and I must say this asset is a core base for me now on multiplayer projects.

    That being said, I am having issues here and there that I slowly solve over time playing around or doing research. But my most recent issue I'm finding to be much harder to solve. It has 2 issues within it but I'm thinking 1 is the cause of the problem.

    First, when the player attacks I change his hand into an obstacle layer. He then attacks with a back handed swing, and at the end an animation event sets his hand back to the original layer. This much works, but isn't tracking properly over the network. Meaning if another player attacks his hand never changes to an obstacle.

    Second, the animations I'm finding to be quite delayed. Or maybe not quite delayed, as when I attack on one the other attacks. But rather not all the time. Like it's only picking it up every few frames.

    I plan on making a video here soon showing my issues. Maybe I'm going about things the wrong way. But the player wiping out becomes an obstacle and that works so far, so I'm not sure why the hand would give issues there using the same method. I also am not sure why animations are so far off.

    Anywho, I will upload a video soon enough to show my issues.
     
  8. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    Just released v2.16 in the Asset Store. This release brings and option to start coroutines when RPCs are implemented as such. This should make a migration from PUN Classic less work.

    v2.16 (26. November 2019)
    Reverted: Some changes in the TypedLobby class. Setting Name and Type does not depend on some other state. Just make sure the Name is not null or empty or the TypedLobby will point to the "default lobby" with a fixed/defined behaviour.
    Fixed: Properly set the received interest group on the PhotonViews of the locally instantiated networked GameObject.
    Fixed: Issue in RegionHandler in WebGL which prevented connection to master server if a scene was loaded during best region ping/calculation.
    Fixed: A rare condition where a region preference can't be parsed into the region and ping values the inspector attempts to show. We check the result of the "split" now.
    Updated: The email check for registrations. Should be more accurate.
    Internal: Optimized Instantiation, RPC calling and sending with cached / reusable keys. This avoids some garbage creation.
    Added: Option to run RPCs as coroutines. Disable with PhotonNetwork.RunRpcCoroutines = false. This makes the upgrade from Pun Classic easier.
    Added: OpJoinRandomOrCreateRoom. When the random matchmaking does not find a suitable room, this operation creates one immediately.
    Added: The Scene Settings inspector now links to the online documentation for this topic. Click the "book" icon which Uniy uses to explain built in components. This works in other cases, too.
    Changed: LoadBalancingPeer and ChatPeer now look for SocketNativeSource instead of SocketWebTcpNativeDynamic when the target platform is XB One. A new Xbox addon is coming up on our SDK page.
    Updated: Photon3Unity3d.dll to v41.2.19.
     
    JohnTube likes this.
  9. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    113
    I'm looking to upgrade my system and get in on the cyber week discount. How can I tell if i have Pun2 or PunClassic installed in my project?
     
  10. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    @whidzee: You could check the PhotonServerSettings asset. The inspector will tell you if it's 2.xy. If that's not at the top of the PhotonServerSettings, you got PUN Classic. Alternatively, check PhotonNetwork.versionPun (Classic) or PhotonNetwork.PunVersion.

    You can get the PUN 2 Plus package in either case. The included 100 CCU "Subscription" will work for PUN Classic and PUN 2. You can switch without any downsides! Unless your project is pretty old, you should update it to PUN 2 in best case.
     
  11. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    310
    Is there way to remove PhotonRigidbodyView without PUN spamming this error:
    IndexOutOfRangeException: Index was outside the bounds of the array.
    @PhotonClasses.cs:1069
    I looked into PUN docs and code and it seems like noone expected that you sometimes need to remove PhotonTransformView or PhotonRigidbodyView without removing PhotonView itself? In my game Im removing rigidbody(to do so I need to destroy PhotonRigidbodyView), but stil want transform to stay in sync and it causes this errors. Tried removing it from PV's ObservedComponents first, doesn't help.
     
  12. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    546
    PUN2 question.
    I'm a PUN1 user, I've also the xbox token service suscribed.

    I did release the game without PUN because I was having very rare issues on getting the tokens, like I suspect could bea bug but had sooo many other non network stuff to fix that I simply ditched MP functionality.

    Now I see its PUN 2, aparently PUN2 supports not only Xbox but also PS. To my knowedge PUN1 does not work on PS, or does it? because I may even consider switching to PUN2 if I can get guarnateed that PS4 will work. Asl I was having terrible sync quality unlike in the past wher eit was butter smooth with lerp.
     
  13. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,430
    Can photon handle 8 players walking around using the streaming api?
    I figured it can as long as I'm not streaming bullets or anything else.
     
  14. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    I'm sorry this is a problem. Yes, it may be tricky to do and is unexpected.
    It may be easier to disable the View or turn it off, so it doesn't write an update anymore.
    We need to know which PUN version you are using to help for the specific case.

    While both PUN versions support the three major consoles, you should better use PUN 2.
    PUN 2 now includes the "PhotonTransformViewClassic", which is responsible for the smoothing of synced movement. It's considered a blueprint which you can improve upon.
    Better synchronization components are coming into beta soon. Those will be for PUN 2 only.

    Shots don't usually need to be "observed", as their origin, speed and direction is fixed. So you could calculate where a bullet is without updates (and should do that).
    Even more players are doable, as various projects show.
     
  15. Roni92pl

    Roni92pl

    Joined:
    Jun 2, 2015
    Posts:
    310
    Thanks for reply.
    PUN v1.91, with no option for upgrade.
    And by View you mean PhotonView?
    Like, I said, I can't turn it off as I still need transform synchronization, just no rb.
    Unless you mean, to turn it off before destroying PhotonRigidbodyView, then turn it on again?
     
  16. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    360
    Hi,

    Yes, tobias means disable the PhotonRigidbodyView, no need to destroy it, just disable it on both instance ( owner and slaved), you can send an rpc to do that across all clients.

    Bye,

    Jean
     
  17. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,430
    @tobiass
    When you use streaming. A client position doesn't go to relay server, to master client, to relay server and then to all clients right?
    Trying to explain to a friend how photon works. I don't think streaming does that right?
    Doesn't it just go from client to relay server and relay server sends the updated position to all clients right?
     
  18. JohnTube

    JohnTube

    Joined:
    Sep 29, 2014
    Posts:
    64
    @Shadowing

    Thank you for choosing Photon!

    In PUN (Photon in general, other than Bolt) everything goes through a relay server.
     
  19. EmreB99

    EmreB99

    Joined:
    Oct 8, 2018
    Posts:
    2
    How will the PUN be affected by the deprecation of Unity's old UNET? Is it using any UNET API's or is PUN and Bolt(or other solutions) operates %100 independent from UNET API?
     
  20. JohnTube

    JohnTube

    Joined:
    Sep 29, 2014
    Posts:
    64
    Hi @EmreB99,

    Thank you for choosing Photon!

    Photon's products are independent of Unity's networking API.
    They will not be affected by the deprecation of UNet.
     
  21. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    Imo Photon is what UNet should've been. But what do I know? I'm just a dumb welder. :rolleyes:o_O:D:cool:
     
  22. Mentallic3D

    Mentallic3D

    Joined:
    Aug 21, 2013
    Posts:
    33
    Using Unity 2019 and PUN2

    I've been having a lot of difficulty with this and was wondering if anyone could assist with some ideas? These are my notes on what seems to be happening:

    after completing the basic tutorial and running 2 instances of the built project several things are incorrect.

    1.) Player A's actions are not shown on Player B's screen

    2.) Player A, when jumping or crouching (we switched out the player for the Standard Assets Third Person controller) both Player A and Player B jump or crouch at the same time

    3.) Player B typically shows 1-2 additional characters on the screen each of which seem to move in different directions than the intended one.

    4.) The players controls work fine in a stand alone room, then change when a second player is introduced

    5.) When using the Editor as the Player A, and running the built application as Player B typically 4 players are spawned (two copies of each), these players are spawned on top of each other which the physics engine solves by spreading them far apart. So far in fact that they fall off of the map.
     
  23. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    Hey Mentallic. So as you've probably already figured out by now with the tutorials you can simply slap on some PhotonViews for transform, rigidbody, etc. to help track your players. But I'm assuming it's not these basic actions that are causing the problems completely. So I'll do my best to answer some of your questions until someone with more knowledge on the subject jumps in.

    1.) So not sure what actions you want happening, but lets say we want a door to open. PUN2 has 2 methods but we can just stick with the first as it reaches all clients and does what we need. And this is called a Remote Procedure Call, or better known in code as RPC. What this does is makes the designated players do whatever methods that are inside this remote call. In this case you'd want to designate to everyone that the door is opening so they can all see it.

    2.) Both players are jumping because our code in the imported third person controller is active and is detecting for our movements. But both players don't belong to us. So to get around this before we do our movement we check to see if we own the player. This of course requires a PhotonView on the player so we can reference it in code with:
    Code (CSharp):
    1. if(photonView.isMine)
    What this does is checks that view if it's yours before we do our actions. That way they don't both jump because we don't own both.

    3.) Not sure on this one. I'm assuming you're instantiating the players as they connect (aka, creating a model for each player as they join). Sounds to me like you may be instantiating too many. Maybe it's something to do with the code being read by both players multiple times as they enter thus creating additional characters. Again, revert to previous answer to help with that.

    4.) You're probably having an input interference because of the models both being under the control of the same player, thus throwing off your movement.

    5.) If they players have physics or colliders then they will ultimately collide or wig out. I recommend spawn points or do the ol' no colliding with other players unless it's required in your game. You can remove collision with other objects by doing layer collisions making so players can't collide with other models tagged Player.

    Hopefully some of these answer some of your questions. I'm not exactly a PUN2 master or even a veteran. I've only been using it less than 3 months. But I can tell you stick with it, because it's In My Opinion the best option out there for smaller individual developers trying to make smaller room based games.
     
  24. Mentallic3D

    Mentallic3D

    Joined:
    Aug 21, 2013
    Posts:
    33
    Thank you so very much for the quick and detailed reply! I will be working on this later today and will take your advice. :)
     
  25. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    45
    Hi,
    I am trying to create a room and joined a player in the room using photon 2. Here is my code.
    //for Create Room
    void CreateAndRoom()
    {
    float randomRoomNo = Random.Range(1.0f, 50.0f);
    RoomOptions RoomOp = new RoomOptions();
    string[] customProperty = {
    playerroomtype
    };
    RoomOp.CustomRoomPropertiesForLobby = customProperty;
    ExitGames.Client.Photon.Hashtable prop = new ExitGames.Client.Photon.Hashtable();
    prop.Add(playerroomtype, "readytojoin"); // playerroomtype is 2 player room or 4 player room
    RoomOp.CustomRoomProperties = prop;
    RoomOp.IsVisible = true;
    RoomOp.IsOpen = true;
    RoomOp.MaxPlayers = (byte)Data.CurrentSelectedPlayer;
    PhotonNetwork.CreateRoom(randomRoomNo.ToString(), RoomOp, TypedLobby.Default);
    Debug.LogError("ROOM NAME " + randomRoomNo.ToString());
    }
    //for joined room and create new room. in this method i am calling in button clicke event
    public void QuickMatchRoomes()
    {
    for (int i = 0; i < createRoom.Count; i++)
    {
    if (createRoom.CustomProperties.ContainsKey(playerroomtype) && createRoom.PlayerCount != Data.CurrentSelectedPlayer)
    {
    if (createRoom.CustomProperties[playerroomtype].ToString() == "readytojoin")
    {
    found = true;
    PhotonNetwork.JoinRoom(createRoom.Name);
    }

    }
    }
    if (found == false)
    {
    CreateAndRoom();
    Code (csharp):
    1. [code]
    [/code] WaitingPanel.SetActive(true);
    }
    }

    Also, I am updating the room list. it works well for 2 player rooms and 4 player rooms. when a new player joined the 2 player rooms and 4 player rooms it 's not working.
     
  26. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
  27. payalzariya07

    payalzariya07

    Joined:
    Oct 5, 2018
    Posts:
    45
    How to make a photon friend list?

    To invite friends and play the multiplayer game.
     
  28. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    @payalzariya07: You'd need accounts for users and a backend that supports friend lists. Photon does not do this but is designed to work well with existing services for this. Have a look at Playfab and Player.io for example.
     
  29. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    Can't you simulate this though using UserID's though if I'm not mistaken?
     
  30. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    This sounds to me like an issue with one of your if statements. Maybe one of your conditions is off. Sometimes it's as simple as forgetting to update the player count
     
    tobiass likes this.
  31. MEHRobert

    MEHRobert

    Joined:
    Nov 5, 2019
    Posts:
    1
    .
     
    Last edited: Jan 12, 2020
  32. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    321
    Not the right area for your post MEHRobert, especially in someone else's thread. But your file isn't loading up with the project properly. Usually an easy fix to this is to right click the unavailable ones and hit reload, or at least try that first.
     
    tobiass likes this.
  33. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    You mean: Store userIDs of friends locally in the client? It's possible but comes with a lot of drawbacks.
    E.g. if you need something like friend requests, you have to make your own systems to ask others if you can be friends...
     
    Foestar likes this.
  34. ddalacu

    ddalacu

    Joined:
    May 13, 2014
    Posts:
    25
    @tobiass can you help with the following bug in the pun2 sdk
    So when photon disconnects because of a connection issue instantiated scene objects do not destroy, the reason is the following :
    LoadBalancingClient.cs line 2582 you guys do the following "this.CurrentRoom = null;"
    then following happens
    LoadBalancingClient.cs line 2626 sets the State property to Disconnected and that property fires a event to notify property change, now in PhotonNetwork.cs static constructor you subscribe that property change and you guys check if state changed from Joined to Disconnected then call PhotonNetworkPart.LeftRoomCleanup which in turn should call PhotonNetworkPart.LocalCleanupAnythingInstantiated but that call never happens because at line 230 in PhotonNetworkPart you have "NetworkingClient.CurrentRoom != null" but that will return false because just at the top of the stack LoadBalancingClient.cs line 2582 CurrentRoom is set to null and LocalCleanupAnythingInstantiated is not called and instantiated game objects are not destroyed.
    Can you make it so cleanup is done when disconnect happens (we will probably fix this ourselves but if we update our changes get overriden)?
     
  35. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    Sorry for the late reaction. I was off on Friday and have to catch up. Will check this out tomorrow.
     
  36. KnightRiderGuy

    KnightRiderGuy

    Joined:
    Nov 23, 2014
    Posts:
    508
    I'm using Pun Voice, I'm having an issue with trying to create three different apps that can talk to each other, I'm finding that in order t make it work I have to make each app all from the same scene in one project??
    Is this normal?
     
  37. JohnTube

    JohnTube

    Joined:
    Sep 29, 2014
    Posts:
    64
    Hi @KnightRiderGuy,

    Thank you for choosing Photon!

    I think maybe you have some matchmaking issues.
    Make sure each client uses the same AppId and AppVersion and connects to the same region.
    Here is our "Matchmaking Checklist".
    What Photon Voice version are you using?

    P.S.: We usually address issues posted on our official forum here.
     
  38. KnightRiderGuy

    KnightRiderGuy

    Joined:
    Nov 23, 2014
    Posts:
    508
    Thanks,
    I did check my project settings for what it was saying in project set up using the pun wizard and in each project my app ID appears to be the same??
    I'm using version 1 of pun Voice, I'm also using Unity version 5.6.3f1
     
  39. onurerler

    onurerler

    Joined:
    Apr 10, 2013
    Posts:
    29
    Hi,
    we have a big problem with PhotonNetwork.ReconnectAndRejoin().
    if ReconnectAndRejoin returns false. nothing starts working right until restart the game. corrupted data begins to come OnPhotonSerializeView method, unexpected rpc's coming. etc.

    we need help asap.

    Thanks.

    unity version 2019.3.0f6
    photon version 2.16
     
  40. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
  41. P3ndragonLLC

    P3ndragonLLC

    Joined:
    Sep 19, 2019
    Posts:
    17
    Hello, I have a question about subscription pricing. If I have a title that will have different people hosting it, can I allow them to have their own applicationid / subscription or is there only one subscription for my application that all installations fall under?
     
  42. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,430
    Ya just create as many app ids you need.
    Then I'd assume each person hosting has some sort of admin log in?
    Then just add the app I'd to thier account on your server side database.
    Then on the client replace the app I'd by script.

    Not sure the api for this. Something like Photon.appID = fhfgcfcgghhihinkjknini


    EDIT: Oh wait I see what you are asking now. Ya idk about that
     
    Last edited: Mar 1, 2020
  43. P3ndragonLLC

    P3ndragonLLC

    Joined:
    Sep 19, 2019
    Posts:
    17
    Thanks for the suggestion, what you mention is a partial alternative useful for segregating billing per customer, I'm also wanting to sandbox groups of people together so that one group wouldn't be able to access another group so it seems like that using the applications the way you're suggesting would seemingly work for that too.

    But yeah, preferably I wouldn't be involved in their billing, it's more of wanting to supply an option to the person hosting the ability for them to use Pun for multiplayer and voice/chat with the ability to scale usage to their group size and provide the privacy and security of them having their own PUN accounts without my observance/involvement. (They may also want to utilize the PUN onsite server)
     
  44. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,430
    Ahh ok. That's simple then. Just give them a form in the admin panel to add thier own photon id.
    Which will add it to thier account in your database.
     
  45. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    What @Shadowing suggests is not allowed by the terms.
    You are not allowed to make your game use multiple appids to avoid payment. Whoever publishes a game has to get a valid license and subscription for it. In doubt, mail us to: developer@photonengine.com to inquire for your use case.

    To separate users into distinct groups, you could use the Game Version string.
     
  46. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,430
    Just to be clear here. I wasn't suggesting doing anything to avoid payment to exit games. I was saying have each admin host have their own subscription to Exit Games.
    But I understand what @tobiass is saying on this. Makes sense if each admin only did the free 20 member thing it wouldn't be right.
     
  47. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    @Shadowing: Thanks for the clarification. I got why you were making that suggestion and it's a pragmatic approach.
    Redistribution and support for multiple customers is a tricky so the general license for subscriptions does not allow it.
    We know this doesn't cover all cases nicely, so simply get in touch if something work out in your case.
     
  48. KayJ_sh

    KayJ_sh

    Joined:
    Apr 14, 2019
    Posts:
    6
    Hi,

    I've got some issues when building the project with Unity clouds. I get lots of errors similar to the following:

    Code (CSharp):
    1. [Unity] Assets/Photon/PhotonRealtime/Code/AppSettings.cs(21,26): error CS0246: The type or namespace name 'ExitGames' could not be found (are you missing a using directive or an assembly reference?)
    2.  
    3. [Unity] Assets/Photon/PhotonRealtime/Code/LoadBalancingClient.cs(1912,46): error CS0246: The type or namespace name 'OperationResponse' could not be found (are you missing a using directive or an assembly reference?)
    4.  
    I don't get any errors when running in Unity itself.

    For a clean setup I removed PUN2 from the project and reimported it from the Asset Store. I got some errors (which I'm sure are related to windows user rights). pun2_import-errors1.jpg . By starting Unity as an administrator I get only one error after import ( pun2_import-errors2.jpg ).

    Building in Unity Cloud results still it lots of errors (see attached text file). Any ideas how to solve this issue?

    Thanks in advance!

    KayJ
     
  49. KayJ_sh

    KayJ_sh

    Joined:
    Apr 14, 2019
    Posts:
    6
    Since I can't upload the log in the previous post: here it is
     

    Attached Files:

  50. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    2,303
    We recently found one workaround for issues with cloud builds (upcoming in PUN 2.17). This may help:

    In PhotonEditor, change the OnProjectChanged() method to start like this:

    Code (CSharp):
    1.         // called in editor, opens wizard for initial setup, keeps scene PhotonViews up to date and closes connections when compiling (to avoid issues)
    2.         private static void OnProjectChanged()
    3.         {
    4.            
    5.             // Prevent issues with Unity Cloud Builds where ServerSettings are not found.
    6.             // Also, within the context of a Unity Cloud Build, ServerSettings is already present anyway.
    7. #if UNITY_CLOUD_BUILD
    8.                      return;  
    9. #endif
    Hope this helps.
    If not, please mail is the new logs: developer@exitgames.com.
     
unityunity