Search Unity

Third Party Photon Unity Networking

Discussion in 'Multiplayer' started by tobiass, Aug 23, 2011.

  1. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    Hi,
    I double-post on unity forum because it's a bit urgent.
    A big and strange problem appeared recently after a random update (and updating to 1.88). At the launch of the update I was able to connect to Photon but after some time (~10 hours), it became impossible. That's the same for almost all of the players. Sometimes a couple of players arrive to connect and then nothing. Here are the logs:
    queueIncomingCommand() CMD(6 c#:0 r/u: 1/0 st/r#/rt:0/0/0) channel seq# r/u: 0/0 01-20 22:58:07.469 29476 29517 I

    01-20 22:58:07.499 29476 29517 I Unity : OnStatusChanged: Connect current State: ConnectingToNameServer

    01-20 22:58:07.499 29476 29517 I Unity : Connected to NameServer.

    Unity : 01-20 22:58:07.679 29476 29517 I Unity : queueIncomingCommand() CMD(6 c#:0 r/u: 2/0 st/r#/rt:0/0/0) channel seq# r/u: 1/0 01-20 22:58:07.679 29476 29517

    Unity : 01-20 22:58:07.759 29476 29517 I Unity : OnStatusChanged: EncryptionEstablished current State: ConnectingToNameServer

    Unity : 01-20 22:58:07.899 29476 29517 I Unity : queueIncomingCommand() CMD(6 c#:0 r/u: 3/0 st/r#/rt:0/0/0) channel seq# r/u: 2/0 01-20 22:58:07.899 29476 29517

    Unity : 01-20 22:58:07.959 29476 29517 I Unity : OperationResponse 220: ReturnCode: 0.

    _____________________

    And then it never stops debugging this:

    Unity : 01-20 22:58:25.629 29476 29517 I Unity : Resending: CMD(5 c#:255 r/u: 18/0 st/r#/rt:18392/1/28392). times out after: 158 sent: 18392 now: 18560 rtt/var: 74/21 last recv: 143

    It happens on android. On my PC it works as expected.
    How can I solve this problem?
    Regards
     
  2. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
  3. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Is it happening when you enter a room with Network Object already there? or is it happening when you explicitly instantiate a network object?

    Can you isolate the problem with a repro case? like using a simple cube and rotate it in a given rotation and check that slaved instances also have this rotation when instantiated?

    Bye,

    Jean
     
  4. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    - Do you mean your game has been running for 10 hours ( a player in a room for 10 hours, or the app opened but in the background for 10 hours?)

    - if you revert to 1.87 is it still happening?

    Bye,

    Jean
     
  5. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    I'll get back to you via pm and introduce you to the team for cross promoting.

    Bye,

    Jean
     
  6. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    After a day of work I found the problem. In fact it wasn't linked to the time. I don't know in which version, but you changed something inside the photon cloud settings (where we set our appId, enabled regions, etc.). Before we were able to enable different regions (e.g. eu + us + ...) whereas now the EnabledRegion is no more an array of selectable regions. Now we can only enable one region. I had created a system that was retrieving through internet a list of regions that I wanted to enable. For example when there wasn't a lot of people, I was enabling only the eu region. If there were a lot of players in brazil and china, I was enabling br + asia. Since the EnabledRegions was no more an array, the system wasn't working.
    The thing that was totally incomprehensible and which slowed me was that during all my tests and at the release of the game, everything was working. I'm not sure but I think there wasn't new players after the launch of the update. I'm also not sure but this problem happened on my side after having uninstalled the game and reinstalled it
     
  7. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    P.S. I don't know why a part of my text was barred
     
  8. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    you can indeed allow multiple regions: There is a whitelist system for each app, you can access it in your dashboard, this whitelist is used when connecting to the best region, BUT it will cache the best region in the player prefs , thus the next time it will directly connect to that best region and ignore a potential change in the whitelist, the solution is to reset this best region playerpref value using PhotonNetwork.OverrideBestCloudServer(CloudRegionCode.none); and connect again.

    Can you test this and confirm it works for you?

    The next release of Pun will feature a system that alwasy check the whitelist before connecting and thus this problem will go away.

    Bye,

    Jean
     
  9. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    That's no more the case on my side. When I select a region, the other selected region becomes unselected. I can't set more than one region and that was the source of the problem. Before we were able to select multiple region but that's no more possible since an update
     
  10. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    I am not too sure where you are inside the photon api and features, can you paste some code snippet on what you do to select a region or where you set the regions? as I said, regions should be set on the website directly inside the dashboard, this is what you do right?

    Bye,

    Jean
     
  11. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    That is not what I was doing before. This is a recent feature. I had created a system similar to this new feature. Before, inside the photon settings (attached picture), we were able to set many regions (for my system, I was doing it via code). It stopped working correctly because you released an update where we can't enable multiple regions via these settings
     

    Attached Files:

  12. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    Hi Jean,
    Just thought I'd drop a quick note to say that my little venture using Photon Networking has now been released.
    I added a credit for Photon in the in-game honours.
    Thanks again for your helpfulness earlier.
    Doug.
     
    Last edited: Jan 26, 2018
  13. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Yes, now you need to set it to "Best Region" and you will gain again the ability to pick many regions. Is that not working on your end neither?

    Bye,

    Jean
     
  14. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Great :) always happy to help!

    Bye,

    Jean
     
  15. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    157
    Hello, I'm searching about networking in Unity and I have much trouble finding the adequate tools.

    About photon, I see that there is a cloud hosting service. What if I don't want to use cloud at all, like for a LAN game for instance?

    What I wish is having server code running on a local network and client code running on the same network and discovering said server and conneting to them and then synchronize information between them (a game let's say).

    Is that possible to do with photon?
     
  16. alexr1221

    alexr1221

    Joined:
    Mar 5, 2016
    Posts:
    70
    Yes it's working :)
     
  17. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Photon Cloud runs OnPremise Server, OnPremise server can be ran wherever you want, so yes, technically, you can run photon on a local network, if that local network has onPremise running.

    https://www.photonengine.com/en-US/OnPremise


    Else, if you don't want to run a dedicated server, then, photon is not the right choice, and you should try Bold, another solution from ExitGames that enabled one client to be the server.

    https://www.photonengine.com/en-US/BOLT

    Or you could run Unity network which also makes one client be the server as well.

    Bye,

    Jean
     
  18. ZoidbergForPresident

    ZoidbergForPresident

    Joined:
    Dec 15, 2015
    Posts:
    157
    Thanks for the info. I think I've found a decent tutorial for Low Level. Cheers.
     
  19. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Hi there. I'm porting a game I made in 4.7.2 to UWP 8.1. The port is almost ready but is lacking the serialization.

    I was using binary formatter so I had to switch to somethign else, I've tried a bunch of serializers but no one fit. I did use json.net and was working nicely but its support for 4.7.2 does not cover UWP 8.1. When I did remove I realized that Photon was droping an exception to console and when checking the photon script , found a surprise. It was using Json.net for serializing.
    Great discovery!.
    I removed Json.net, reimport current photon+, did a build test and bang, it does build so I told myself awesome gonna use photon serialization.

    Checked docs if it does serialize dics and does as Dictionary<object,object> so, awesome, it will cruch dictionaries as did the json.net.... anddd. no it didnt XD

    I attemped this:
    Code (CSharp):
    1.         Common.IO.FileHandle.WriteAllBytes(Application.persistentDataPath + "/AI.dat",Protocol.Serialize (TankDictionary));
    2.  
    get this:
    Exception: Unexpected - cannot serialize Dictionary with value type: System.String
    ExitGames.Client.Photon.Protocol16.SerializeDictionaryHeader (ExitGames.Client.Photon.StreamBuffer writer, System.Object dict, System.Boolean& setKeyType, System.Boolean& setValueType)

    etc...

    Any cloues on how should I serialize the dictionary?

    its a Dictionary<string,TankProperties>

    Where tank properties is an struct and vehicle model within is an enum:
    Code (CSharp):
    1. public class TankProperties   {
    2.  
    3.     public bool isPlayer;
    4.     public int team;
    5.     public int faction;
    6.     public int  vehicleType;
    7.     //public string model;
    8.     public vehicleModel model;
    9.     public int tier;
    10.     public int skin;
    11.     public int count;
    12.     public int era;
    13.  
    14.  
    15.     //public  TankProperties  (bool _isPlayer, int _team, int _faction,int  _vehicleType, string _model, int _tier , int _skin, int _count)
    16.     public  TankProperties  (bool _isPlayer, int _team, int _faction,int  _vehicleType, vehicleModel _model, int _tier , int _skin, int _count, int _era)
    17.  
    18.     {
    19.         isPlayer     =     _isPlayer;
    20.         team         =    _team;
    21.         faction     =     _faction;
    22.         vehicleType =     _vehicleType;
    23.         model         =    _model;
    24.         tier         =     _tier;
    25.         skin         =    _skin;
    26.         count         =    _count;
    27.         era            =   _era;
    28.     }
    29. }
    30.  
    31.  


     
  20. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
  21. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    OK, I found out that Json.net is ONLY used in editor mod by photon :\

    all under #if UNITY_EDITOR

    I found stuff like:

    Code (CSharp):
    1. Dictionary<string, string> values = JsonConvert.DeserializeObject<Dictionary<string, string>>(result);
    I'm going to try again with Sharpserializer
     
    Last edited: Feb 2, 2018
  22. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Ok I think I managed to solve it with sharpserializer, at least it builds I managed to compile in VS and run the game but I'm gettin the console flooded with exceptions related to photon.

    I downloaded the latest photon+ and I'm using VS2013, may be they're not compatible? Latest version does require any VS specific ?

    this is an screen capture of what I'm getting:
     

    Attached Files:

  23. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    what version of Unity are you using? are you still on uwp platform target?

    Bye,

    Jean
     
  24. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Hello. Unity 4.7.2 targeting WS8.1.

    Json.net dev conatcted me and sent me a dll that does build. In VS the console gets absolutely flooded with exceptions related to Photon. I've just stripped all photon code from the game to see fi its just photon or there is somehting else.
     
  25. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    If you are using a fresh project and just Photon as is and compile the demos, does it work or do you get the same issue? the error you get do not seem to be related to the serializer.

    Bye,

    Jean
     
  26. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,853
    Hi Jean. I am deciding between Unity Networking and Photon. Ease of implementation of the basics will factor into that decision hugely. Unity resources seem to be all over the map with most examples looking out of date or requiring the extraction of pertinent parts from a game..think Tanks..and then ripping out the Tanks stuff and using it for my app. I do not have time not the inclination to do this. Who pays my bills whilst I futz around...

    What I need is simple. It is a project management app where users avatars can walk around a construction project together and exchange voice and text chat. The room should be restricted to list of users who are associated with that project. It seems simple enough but i have to jump through hoops and go through reams of docs to find out how to do this simple stuff. I did download the Photon Asset Store package and have the demo open. I can't connect to anything. On the Create A New App on the Dashboard is a field for a URL. I do not understand nor can find any info on what goes in there. Is this why I cannot connect?
     
  27. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Yeah, Unity Networking is sadly not really fit for production and long term projects, it's a competitor of Photon, sure, but I think it does a lot of harm and frustrate people more than it helps.

    anyway... yes, you likely did not set up your appid inside the project properly.

    Copy your appId from your dashboard and paste it inside the ServerSettings in your project ( Unity menu: Window/Photon Unity Networking/Highlight Server settings)

    Then, you will be able to connect. Else can you paste the warnings or error you get as you play one of our demo?

    Bye,

    Jean
     
  28. yomanx

    yomanx

    Joined:
    Dec 5, 2016
    Posts:
    38
    Hi guys,

    Can we check players parameters (level, skill level et c) through the photon before the battle?

    I want to get all players in lobby and the filter them by skill-level, how to make it?
     
  29. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    WHen you list games you could have in the room properties a minimum skill level or whatever minimum value needed and filter available rooms depending on users score. So in the end would be clients checking if they can join rather server checking if they can join but end ressult would be same as you look for.
     
  30. rubble1

    rubble1

    Joined:
    Apr 25, 2010
    Posts:
    84
    Hi,

    I need to call a script from a remote object.
    My question is how would I reference the remote player across the network?

    I am instantiating in my player who's remote version has a simpler setup than the one being controlled by the player.
    The remote's PhotonView only observes the Animator, the Transform, and a "Reaction" script, that will send a message to the Controller script that controls the animator. Because of certain settings, this Controller can not be put on the remote. Is there a way I can simply reference this on the message the remote sends out to the player?

    What I'm trying is this:

    Code (CSharp):
    1. int PhotonID = mActorCore.GetComponent().ownerId;
    2. PhotonView mPhotonView = PhotonView.Find(PhotonID);
    Any help would be much appreciated.
     
  31. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    you can expose room custom properties to the lobby,a nd also use special matchmaking lobbies to join rooms using rules based on values from rooms:

    something like:

    RoomOptions roomOptions = new RoomOptions();
    roomOptions.MaxPlayers = expectedMaxPlayers;
    // in this example, C0 might be 0 or 1 for the two (fictional) game modes
    roomOptions.CustomRoomProperties = new ExitGames.Client.Photon.Hashtable() { { "C0", 1 } };
    roomOptions.CustomRoomPropertiesForLobby = new string[] { "C0" }; // this makes "C0" available in the lobby
    // let's create this room in SqlLobby "myLobby" explicitly
    TypedLobby sqlLobby = new TypedLobby("myLobby", LobbyType.SqlLobby);
    lbClient.OpCreateRoom(roomName, roomOptions, sqlLobby);

    and then you can choose to join a room using C0 parameter like so:

    TypedLobby sqlLobby = new TypedLobby("myLobby", LobbyType.SqlLobby); // same as above
    string sqlLobbyFilter = "C0 = 0"; // find a game with mode 0
    lbClient.OpJoinRandomRoom(null, expectedMaxPlayers, matchmakingMode, sqlLobby, sqlLobbyFilter);
    // other filter examples:
    // "C0 = 1 OR C6 > 50"
    // "C5 = \"Map2\" AND C2 > 10 AND C3 < 20"
    // "C8 BETWEEN 0 AND 100"
    // "C4 IN ('Map1', 'Map2', 'Map3')"


    Read careful the whole page on this, it features all you need to achieve this:
    https://doc.photonengine.com/en-us/realtime/current/reference/matchmaking-and-lobby

    Bye,

    Jean
     
  32. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    What's not working with your snippet code?

    I am not too sure what you are trying to achieve. Is your controller observed by a PhotonView? if that's the case, then yse, I think you will run into trouble.

    One very straight forward way, is to make your controller aware of the network context, and have it disable or modify its behaviour if it finds itself on a remote instance of on the owner instance, using <PhotonView>.IsMine property.. This will be a lot easier to handle in general.

    Bye,

    Jean
     
    rubble1 likes this.
  33. BogdanT91

    BogdanT91

    Joined:
    Feb 21, 2018
    Posts:
    4
    I have made a simple 2D game for Android where you have to shoot something and the score is how much time you survive.

    I want to offer monthly prizes to the first highest scorer of the respective month. Such monthly prize will be in money, therefore i have to move my game logic to a dedicated server.

    From what i understand talking on this forum, i would need a Client/Server arhitecture, where the server receives the user input, then runs all the game logic (i wonder how it will be done given that my platform is Android and the server probably runs linux?) and finally the client api only renders the graphics.

    I have already built the game in Unity, what is the most appropriate Photon service for the above? There are already built plugins or other features Photon provides that makes this possibility easier? If not, please tell me from where should I start learning in this regard.

    At this point i don't have any familiarity with PUN/Bolt (this will probably change given your input).

    Thank you
     
  34. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    The question is if your game allows players to play together in the same level? that is players can see each others while playing. If that's the case, then yes, Photon is a good solution. but it won't be implemented as you described it. Photon doesn't have a typical client/server architecture, instead, no code or logic is ran on the server, one of the client is elected Master and will act as the server and will have some special rights, so the development is a lot easier this way,

    To get up and running with Photon, Please follow the basic step by step tutorial:

    https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/intro


    now, for the highscore: Photon do not provide any mean for data to persist outside the game life time, so you will need to use an external database and load save your highscore in there. You can you something as simple as a Php/mysql setup or go with the GameCenter on IOS for example.

    Bye,

    Jean
     
  35. Fortitude3D

    Fortitude3D

    Joined:
    Sep 7, 2017
    Posts:
    155
    Photon literally makes it so much easier to make multiplayer games..well done gentleman
     
    Jean-Fabre and Munchy2007 like this.
  36. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    anyone knows what's on the latest update (1.89)? i came here for the release notes and i see nothing...
     
  37. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    Yep, definitly, and the amazing thing is that it makes it easier both on the client dev side but also on the server side, which basically is gone with Photon Cloud, and for 90% of network games, this is the likely best solution for a trouble free hosting solution for your games at a fraction of the cost of hosting servers yourself on amazon or else.

    Bye,

    Jean
     
  38. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    On it now :) Tobias will update the first thread, but let me put the 1.89 version log on the next post

    Bye,

    Jean
     
  39. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi Everyone,

    so v1.89 is out now, It's mainly to be compatible with Unity 2018. Though While 2018 is in beta, we don't know what will change for the final release, but at least this is a start.

    Also, as a warning ( as we get lots of support on this), the .net 4.6 experimental feature of Unity 2017 and 2018 is problematic and erratic, and PUN do not support projects using this, there are too many very odd issues unfortunatly.

    here's the changelog:

    v1.89 (26. February 2018)
    Changed: Best Region connection routine now takes in consideration the regions whitelist and correctly handle the saved best region pref, ignoring it if not in the whiteList anymore.
    Updated: Unity 2018 compatibility update to fix errors and obsolete warnings
    Fixed: KickOut/CloseConnection Call to properly make player leave room without becoming inactive
    Updated: Removed Substance designer materials for Unity 2018 compatibility

    Bye,

    Jean
     
  40. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    hmm well on 2018 it would fail if you try to build for UWP. The reason is because on some part of the code (i'm not on my computer but i believe it was on the LoadBalancing api), you have #if UNITY_2017 somewhere instead of _OR_NEWER
     
  41. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    ok, we'll investigate, thanks for reporting :)

    Bye,

    Jean
     
  42. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Ok, from our tests, everything works as expected, can you double check and maybe try with a fresh project just to make sure nothing got corrupted during the update process or something?

    else, can you give more details about the error you get and what is your uwp build setup?

    Bye,

    Jean
     
  43. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    maybe it was the photon voice package the one that included that since it's on the photonloadbalancing api
     
  44. Jean-Fabre

    Jean-Fabre

    Joined:
    Sep 6, 2007
    Posts:
    429
    Hi,

    PhotonVoice package is separate from PUN, so it could be yes.

    Bye,

    Jean
     
  45. roka

    roka

    Joined:
    Sep 12, 2010
    Posts:
    598
    I don't have any problem on 2018/WebGL at the moment for me
     
  46. scvnathan

    scvnathan

    Joined:
    Apr 29, 2016
    Posts:
    75
    Hi Jean, we've been using 4.6 for the past couple of months and haven't had any issues with Photon (yet). Do you have a list of issues related to 4.6 + Photon so we can keep an eye out for them? We heavily use 4.6/C# 6 features in our project and it would be shame if that stopped our usage of Photon, especially with it becoming the default option in 2018.1

    Thanks
     
  47. rusildo

    rusildo

    Joined:
    Oct 10, 2014
    Posts:
    18
    Can you explain how this works? Can I configure this behavior? I launched a test project on Android, turned off the tablet and ~40 seconds later I was kickout of the room.
     
  48. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Illegal view ID:0 method: CreateSpawn GO:Jaffa Cargo Ship Patrol

    What are some reasons in getting this error?
    I spawn all my networking things like this below.
    There is no issues spawning anything else in my game.
    For some reason im spawning things from a ship later on in the game I get hit with this error. Even though everything seems to work.

    Code (csharp):
    1. int id = PhotonNetwork.AllocateViewID();
    2. photonView.RPC("CreateSpawn", PhotonTargets.AllBuffered, Position,Rotation, id, key);
    Code (csharp):
    1. [PunRPC]
    2. void CreateSpawn(Vector3 Position,Vector3 Rotation,int id,int key){
    3.        Transform NewSpawn = Instantiate(Prefab, Position, new Quaternion()).transform;
    4.        PhotonView SpawnPhotonView = NewSpawn.GetComponent<PhotonView>();
    5.        SpawnPhotonView.viewID = id;
    6.  
    7. }
     
    Last edited: Mar 4, 2018
  49. Doug_B

    Doug_B

    Joined:
    Jun 4, 2017
    Posts:
    1,596
    Hi Shadowing,

    Back in 2014, it looked like there was an issue adding a PhotonView to a Prefab after instances had been placed into scenes. User 82apps saw this in May of that year. Is that what you are seeing here - or maybe that issue has now been resolved in Photon?

    Just to add, if the reason you are self spawning is to use a Unity prefab over the Photon method requiring a string path to a resource, I created an editor extension to help ease that situation here:
     
  50. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ya that's what I'm doing. I'm adding a photon view to a new Game object()
    I could create a prefab I guess for that.
    That kinda stinks though cause I was planning on adding the photon view component by script for all networking objects. I'll read that link you gave me.

    Your code you posted isn't showing?

    Here is what i'm doing
    Code (csharp):
    1.  
    2. GameObject SpawnGameObject = new GameObject(spawn.name,typeof(PhotonView));
    3. Spawn transportSpawn = SpawnGameObject.AddComponent<Spawn>();
    4. transportSpawn.StartSpawn(SpawnType.MobNPC);
    5.  

    I don't understand 82apps work around lol
    I had an idea. Maybe I have to wait until the next frame before assigning a photon view I'd.
     
    Last edited: Mar 5, 2018