Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Showcase Mirror - Open Source Networking for Unity

Discussion in 'Multiplayer' started by mischa2k, Aug 11, 2016.

  1. Alex1337rus

    Alex1337rus

    Joined:
    Mar 30, 2016
    Posts:
    37
    Hello! I want to make game like minecraft or valheim. Is it possible with mirror?
    I just need next things:
    1) A large world that cannot be loaded into memory. (Stored in files and loaded by chunks)
    2) Add blocks
    3) Remove blocks
    4) Synchronize world for all players
    Any examples or tips?
     
  2. J_B_R_UnityDeveloper

    J_B_R_UnityDeveloper

    Joined:
    Oct 5, 2020
    Posts:
    7
    Good Morning. I have a synchronization problem with clients.

    The server shows the animation of the clients, but the clients do not see the animation of the other clients, nor their own. It only happens with the animation associated with the bool ("zoom").

    I need help, thank you.

    ////////////////////////////////////////////////////////////////

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using Mirror;

    public class ActivarMiraArma : NetworkBehaviour
    {
    public Camera cámaraArma;
    public Camera cámaraM4;
    public Camera cámaraBeretta92;
    public Camera cámaraBayesta;
    public Animator anim;
    [SyncVar] public bool zoom = false;
    public float tiempoProgramado = 0.25f;
    public float tiempo;
    public GameObject jugador;
    public GameObject Arma;


    public void Start()
    {
    jugador = this.transform.gameObject;
    }


    public void Update()
    {
    if (isLocalPlayer)
    {
    if (tiempo > 0)
    tiempo -= Time.deltaTime;
    if (anim == null)
    anim = transform.GetComponent<Animator>();
    Arma = GameObject.FindWithTag("ArmaMontada");
    if (Arma == null) return;
    if (Arma.name == "M4")
    {
    cámaraArma = cámaraM4;
    activarCámaraM4();
    }
    if (Arma.name == "Beretta92")
    {
    cámaraArma = cámaraBeretta92;
    activarCámaraBeretta92();
    }
    if (Arma.name == "Crossbow")
    {
    cámaraArma = cámaraBayesta;
    activarCámaraBayesta();
    }
    if (Input.GetMouseButton(1))
    {
    if (zoom == true) return;
    CmdZoomTrue();
    }
    else
    {
    CmdZoomFalse();
    anim.SetBool("Zoom", false);
    zoom = false;
    }
    if (Input.GetMouseButton(0))
    {
    anim.SetBool("Ratón Izquierdo", true);
    }
    else anim.SetBool("Ratón Izquierdo", false);
    }

    }


    [Command]
    void CmdZoomTrue()
    {
    anim.SetBool("Zoom", true);
    zoom = true;
    }
    [Command]
    void CmdZoomFalse()
    {
    anim.SetBool("Zoom", false);
    zoom = false;
    }


    public void activarCámaraBeretta92()
    {
    if (isLocalPlayer)
    {
    cámaraBayesta.enabled = false;
    cámaraM4.enabled = false;
    cámaraBeretta92.enabled = false;

    if (zoom == true)
    {
    temporizador();
    }
    else
    {
    cámaraArma.enabled = false;
    tiempo = tiempoProgramado;
    }
    }
    }


    public void activarCámaraM4()
    {
    cámaraBayesta.enabled = false;
    cámaraM4.enabled = false;
    cámaraBeretta92.enabled = false;
    if (zoom == true)
    {
    temporizador();
    }
    else
    {
    cámaraArma.enabled = false;
    tiempo = tiempoProgramado;
    }
    }


    public void activarCámaraBayesta()
    {
    cámaraBayesta.enabled = false;
    cámaraM4.enabled = false;
    cámaraBeretta92.enabled = false;
    if (zoom == true)
    {
    temporizador();
    }
    else
    {
    cámaraArma.enabled = false;
    tiempo = tiempoProgramado;
    }
    }


    public void temporizador()
    {
    if (tiempo <= 0)
    {
    cámaraArma.enabled = true;
    tiempo = 0;
    }
    }
    }
     
  3. InteractivePie

    InteractivePie

    Joined:
    May 2, 2014
    Posts:
    18
    Hello @vis2k,

    First off I would like to say that I'm very happy with Mirror. Im creating a game and things are looking smooth. I have a question around security for Dedicated servers:

    Say if I upload my server build to an external webserver that is reachable by port 7777. Now I will make another Unity project that connects to the same server but with completely different client code (expecting it would know about the server code). Would it work? Could somebody do something malicious in that case?

    I also wonder the other way around. It would be nice to keep things clear and to have a separate Unity project with only server code, and let another unity project connect to it as client only.

    Or is it intended to have the client and server code in one unity project so that it will always be secure connecting to the dedicated server?
     
  4. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Most servers run on Linux, where you can see the source code too. Doesn't mean it's not secure :)
    You can use #if UNITY_SERVER to remove server-only code from the client if necessary.
     
  5. BlastM

    BlastM

    Joined:
    Jun 17, 2021
    Posts:
    2
    Hi @vis2k
    Today I tested my game on mobile and something caught my attention. When I close wifi or cellular, on client disconnect function calling without any timeout. This occurs only client side, server fires disconnect event still after timeout. Why?
     
  6. LuxindraGaming

    LuxindraGaming

    Joined:
    Sep 2, 2020
    Posts:
    4
    hi, @vis2k @Tornadoally @tomweiland @TwoTen @PartyBoat I'm new in multiplayer game with mirror networking and I'm still learning. I want one help from you guys, how I join random room and if there is no room available then create its own room. is there any way to do that. if you have any solution with the script please provide.

    Like, I'm making a simple board game and in first scene there will be one button says Play Button. Using this play button player will find random room and if room available then join else create its own room.
    please give a script if you have any.

    Thanks in advance.
     
  7. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
  8. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Mirror V46 LTS (Long Term Support) is live!
    mirror_icon_1200x300_GITHUB_M_smaller.png

    If you use Mirror in production, consider Mirror LTS!

    =>
    Bug fixes only.
    => Consistent API: update any time, without any breaking features.
    =>
    Lives along side Unity 2019 LTS.
    =>
    Supported from Sept. 2021 to Sept. 2022, depending on feedback.

    All GitHub Sponsors are invited automatically.
     
    LiLyDarcy, xVergilx and mgear like this.
  9. Kanyade

    Kanyade

    Joined:
    Jul 9, 2021
    Posts:
    1
    Greetings!

    I only recently discovered Mirror and I'm kind of lost in all of the information available.
    I want a basic 'client sends data to server' method with Mirror, so like inside a function I send some data to the server and the server does whatever it wants with that. The client does not require acknowledgement and if a data is lost then it does not matter, it continues to live its life, so UDP is preferred.

    Can you guide me to somewhere where I can find it out how to do it? Or show a basic example?
    The examples provided consist of too many files and components for me to understand in a day and I would need to solve this as soon as I can.

    The main issue is that for example in the Chat example, the ChatNetwork manager has only like 50 lines of codes, while the button Start server calls the ChatNetwork manager's StartHost function, which I don't see, that's why it is hard to debug to match my case. In the future I would like to work with Mirror, that's why I would like to stick to it now as well.

    Thank you in advance!
     
    Last edited: Sep 9, 2021
  10. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Hey guys, significant performance update coming.
    https://github.com/vis2k/Mirror/pull/2922

    Previously SyncLists/SyncDicts dirty checks required iterating all the SyncLists/SyncDicts.
    This was O(N) complexity:
    Code (CSharp):
    1.         internal ulong DirtyObjectBits()
    2.         {
    3.             ulong dirtyObjects = 0;
    4.             for (int i = 0; i < syncObjects.Count; i++)
    5.             {
    6.                 SyncObject syncObject = syncObjects[i];
    7.                 if (syncObject.IsDirty)
    8.                 {
    9.                     dirtyObjects |= 1UL << i;
    10.                 }
    11.             }
    12.             return dirtyObjects;
    13.         }
    14.  
    15.         // internal for tests
    16.         // reuses DirtyObjectBits for simplicity.
    17.         internal bool AnySyncObjectDirty() => DirtyObjectBits() != 0UL;
    Now it's O(1) by using a dirty mask:
    Code (CSharp):
    1.  
    2.             // OnDirty needs to set nth bit in our dirty mask
    3.             ulong nthBit = 1UL << index;
    4.             syncObject.OnDirty = () => syncObjectDirtyBits |= nthBit;
    A lot of people noticed the old code showing up in the profiler.
    Not anymore :)
     
    akuno and hopeful like this.
  11. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Next major performance improvement.
    https://github.com/vis2k/Mirror/pull/2923

    Previously, NetworkServer.Update iterated all connections and all spawned entities.
    With this change, it only has to iterate all connections.

    This is huge for scaling.
     
  12. lightray41

    lightray41

    Joined:
    Apr 16, 2020
    Posts:
    2
    Hi! I have an issue with Mirror running the simplest example.
    Mirror version: downloaded just now. Unity: 2019.4.9 LTS
    1. Import mirror
    2. Build 'Pong' scene from Examples.
    3. Run created .exe as server (localhost).
    4. Enter play mode in Unity and play is client.
    5. Move racket up and down.
    The ball sometimes goes through the client rocket. The ball sometimes jumps off the empty space where the racket was recently.
     
  13. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    The pong example is not ideal. We put this together in 15 minutes or so :)
     
  14. LiLyDarcy

    LiLyDarcy

    Joined:
    Oct 10, 2018
    Posts:
    15
    thank vis2k thank mirror
    Ask a question
    I want to use a list to make a room system, a multi-person room, and the same IP, I hope there is a tutorial, many rooms, where can I have such a tutorial?
    thanks
    thanks
     
  15. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    FYI if anyone encountered KCP 'dead_link' disconnects: max retransmission attempts are now configurable in the Inspector and the disconnect message will say exactly how many times it tried to retransmit.

    Note that the default was '20' and we increased it to '40'.
     
    hopeful likes this.
  16. lightray41

    lightray41

    Joined:
    Apr 16, 2020
    Posts:
    2
    i have double-checked your SnapshotInterpolation.Compute method and it seems to me your implementation is wrong. It works, but it adds unnecesary delay on the client side.
    Specifically, this comment line and the code after it are incorrect: "we always need two OLD ENOUGH snapshots to interpolate. otherwise there's nothing to do".
    Actually this is the only purpose of the buffer - sometimes to use snapshots which are NOT old enough (in case of packet loss). Or am I missing something?
    It looks like I can safely use your code with bufferTime=0 and it will work better.
     
  17. LiLyDarcy

    LiLyDarcy

    Joined:
    Oct 10, 2018
    Posts:
    15
    we have a problem! Multi-scene switching, and players can be synchronized in the scene. How should I make it? Is there a video tutorial for reference? grateful! grateful!:)
     
  18. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Hi, this is Brian Hunsaker, creator Master Audio Multiplayer, which has integration with Mirror. A recent change now pops up the following warning:

    warning CS0618: 'NetworkIdentity.spawned' is obsolete: 'NetworkIdentity.spawned is now NetworkServer.spawned on server, NetworkClient.spawned on client.

    Seems easy enough to fix, except that I'm not sure how to determine if the code running is on the server or the client. Can you let me know how that's done? Thank you,

    -B
     
  19. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    You can use Utils.GetSpawnedInServerOrClient if you aren't sure :)
     
  20. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Thanks! I modified the code to:
    Code (csharp):
    1.  
    2.         private static Transform FindTransformForReplicatedAudio(uint sourceViewId, string transformPath, string functionName) {
    3.             var networkId = Utils.GetSpawnedInServerOrClient(sourceViewId);
    4.             var isClient = networkId.isClient;
    5.  
    6.             var clientView = isClient ? NetworkClient.spawned[sourceViewId] : NetworkServer.spawned[sourceViewId];
    7.  
    8.  
     
  21. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    just do var clientView = Utils.GetSpawnedInServerOrClient(sourceViewId)
     
  22. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    Oh ok, I see, thank you!
     
  23. nathanielguy-wp

    nathanielguy-wp

    Joined:
    Oct 4, 2021
    Posts:
    1
    Hi all. I was wondering if you could give me some advice for something I'm trying to do.

    My team is building a server-client system in Unity, where the server is authoritative and running lots of logic, but it's headless up in the cloud somewhere, so we're not doing any rendering--we actually don't use GameObjects at all for performance reasons, but instead use classes with external update methods and keep track of things like transforms manually. (This isn't all that different from certain projects that use direct rendering with Graphics.DrawMeshInstanced(), I think.) But on the client, we're using GameObjects and rendering them pretty traditionally with MeshRenderers and Transforms; we're just not running the logic for their behavior (that all lives on the server).

    We'd like to take advantage of Mirror's network spawning and network transform system, if possible, so that we can mirror state across the network automatically. But without GameObjects on the server side, I'm not sure if this is possible out-of-the-box.

    Does anyone have any ideas, or has anyone done something like this before? Is there some included feature that's already available to make this possible? We can modify Mirror's source if necessary, but if anyone has any tips they would be welcomed. (I was considering keeping track of NetworkIdentity instances manually, and using modified forms of NetworkManager and NetworkTransform such that the server input comes from our own internal object management systems, but the output to the client is more or less the same. But I haven't looked through the source thoroughly enough to know how much work this would be.)
     
  24. XCO

    XCO

    Joined:
    Nov 17, 2012
    Posts:
    379
    If anyone wants to help me build an online multiplayer for a fighting game for the PS5 - Please send me a Direct message :)
     
  25. Punfish

    Punfish

    Joined:
    Dec 7, 2014
    Posts:
    389
    Yes, I do see the humor in writing this...but since your question has gone unanswered thought I'd let you know that Fish Networking supports this built in. There's no catches, it's included free.
     
    DCTShinobi likes this.
  26. Threeyes

    Threeyes

    Joined:
    Jun 19, 2014
    Posts:
    80
    Hi! When I use [ClientRpc(includeOwner = false)]on player objects, everything works fine, but when I use the same code on non-player objects, itself seems to receive the callback.
    Does it means that includeOwner will not work on non-player objects?

    Here's the code, when Client A's UIToggle value get changed, it will let all the other Client’s relate ui sync:

    Code (CSharp):
    1.  
    2.    public Toggle toggle;
    3.    NetworkIdentity networkIdentityLastReceive;
    4.  
    5.     void Init()
    6.     {
    7.         toggle.onValueChanged.AddListener(OnToggle);
    8.     }
    9.     private void OnPlayStop(bool isPlay)
    10.     {
    11.         if (networkIdentityLastReceive != null)
    12.             return;
    13.         CMDSetToggle(isPlay);
    14.     }
    15.  
    16.     [Command(requiresAuthority = false)]
    17.     public void CMDSetToggle(bool isOn)
    18.     {
    19.         RPCSetToggle(isOn);
    20.     }
    21.     [ClientRpc(includeOwner = false)]
    22.     void RPCSetToggle(bool isOn)
    23.     {
    24.         networkIdentityLastReceive = networkIdentity;
    25.         toggle.isOn = isOn;//Let UI update onValueChanged event
    26.         networkIdentityLastReceive = null;
    27.     }
    28.  
     
    Last edited: Mar 3, 2022
  27. haianh_nguyenvu1991

    haianh_nguyenvu1991

    Joined:
    Jan 27, 2018
    Posts:
    8
    hi @vis2k !
    I need help. When I use [Command] to send a custom class to server. it will success if class has only one field int.

    success send class:
    class TestData
    {
    int intValue;
    }

    fail send class:
    class TestData
    {
    int intValue_01;
    int intValue_02;
    }
    or i change to Vector3 it will fail too.
    class TestData
    {
    Vector3 sendValue;
    }

    error msg:
    "Disconnecting connId=0 to prevent exploits from an Exception in MessageHandler: FormatException Index (zero based) must be greater than or equal to zero and less than the size of the argument list."
     
  28. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Can't see your screen from here, you'd have to share the command part too.
     
  29. haianh_nguyenvu1991

    haianh_nguyenvu1991

    Joined:
    Jan 27, 2018
    Posts:
    8
    Thanks @vis2k . this is my mistake. not mirror. I found the problem.
     
    mischa2k likes this.
  30. BenBlum

    BenBlum

    Joined:
    May 20, 2021
    Posts:
    3
    Hey I'm refactoring an existing system that use WebSocket as its communication protocol, right now I'm using nodeJs as the server and I would like to use mirror instance as the server, I have few issues with it, 1. Is there an easy way to connect unity mirror server to a web application client? 2. we are communication with Json at the moment, is there an easy way to setup mirror to accept and process Json? I would like to refactor only one side of the code
     
  31. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Our websocket transport allows you to connect a Unity WebGL client to a Unity standalone server.
    If that's what you are asking.
    Accepting & processing JSON sounds like a general C# task, probably plenty of solutions out there :)
     
  32. zhenhaoze

    zhenhaoze

    Joined:
    Dec 9, 2019
    Posts:
    1
    Hi, can anyone help me. How do I get the spawned object when I use NetworkServer.spawn
     
  33. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    GameObject go = Instantiate(prefab);
    NetworkServer.spawn(go);
    // go is the spawned object
     
  34. benforcapita

    benforcapita

    Joined:
    Jul 21, 2015
    Posts:
    1
    How can I Video stream over Lan without an internet connection using mirror?

    We are building medical rehabilitation solution for hospitals that require us to run our app offline with no external internet connection.

    our solution has two applications, the ‘server’ and the ‘client’ apps.

    The client is basically the controller for the ‘server’ app. We used an external signaling server until now to communicate between them, but now we need to be able to communicate without an external internet connection due to the hospital restrictions.

    we tried to use webRTC and web application as our client.

    We were thinking that a website can render a video we were sending from unity but it seems that browsers don’t like using webRTC without an internet connection even when we are running the app from the local machine.

    831926 - can't create a peer connection on without network connection (mozilla.org)

    To create a client in Chrome that would render a video I needed to add a virtual network adapter for that to work and even then the connection is unstable

    So, we are looking into using unity client as an alternative

    I have already managed to send messages between two applications on the same network using mirror, so video streaming remains my main problem right now.

    1. Can we use WebRTC | WebRTC | 2.4.0-exp.6 (unity3d.com) to stream video using mirror without the internet and if we can be there any examples of how to do that?

    2. Are there other solutions that can work with the requirement of no internet?

    3. We are looking into FMETP STREAM V2 | Packs | Unity Asset Store as a possible solution, can I use mirror in a similar way?


    I know about GitHub - snotball/mirror-webrtc: WebRTC based Transport for Mirror Networking

    But this solution uses an external signaling server and stun servers that I cannot use due to the application needing to work offline.
     
  35. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    If webRTC doesn't allow connections without internet, then your client would also need to be in Unity and running as a regular .exe.

    That's easy to do with mirror. just use the built in kcp transport or the telepathy transport :)
     
  36. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    April update.

    We reduced Rpc/Cmd functionHash overhead from 4 => 2 bytes recently:
    https://github.com/vis2k/Mirror/pull/3119

    Also reduced memory overhead significantly. Batches are now built on the fly, instead of at the end of the frame:
    https://github.com/vis2k/Mirror/pull/3130

    Open issues are down from 69 to 50 ish. Goal is to get to 0.
    https://github.com/vis2k/Mirror/issues

    LocalWorldState is stable in our experimental branch.
    This is for the upcoming CCU test, where instead of sending one message per entity update, we will put them all into one big LocalWorldState message per connection.
     
    Willbkool_FPCS and hopeful like this.
  37. dhhdumi

    dhhdumi

    Joined:
    Aug 3, 2019
    Posts:
    5
    Hi, Can I send pictures between clients? I use it to make an application to share photos between devices in the LAN. Image size: 5-10mb.
     
  38. jesusluvsyooh

    jesusluvsyooh

    Joined:
    Jan 10, 2012
    Posts:
    377
    hihi, although its not recommended to use a gaming netcode for large file transfer, unity www webrequests and a storage server would be best. It can still be done, i have this template laying around which may be of use for you, you may have to adjust transport send/receive limits, or splitting up the byte arrays into parts and sending part 1, 2, 3 etc
    Enjoy!

    1: Convert image/audio to bytes (codes on google for Unity image to bytes)
    2: Use this script to send bytes to host/ and optionally back to players
    3: Convert from bytes back to original type (codes on google)

    Code (CSharp):
    1. using Mirror;
    2. using UnityEngine;
    3.  
    4. public class PlayerSendBytes : NetworkBehaviour
    5. {
    6.    private float sendInterval = 0.1f;  // 10 times per second
    7.    private byte[] dataArrayByte;
    8.  
    9.  
    10.    public override void OnStartLocalPlayer()
    11.    {
    12.        // some sort of frequent sending for constant webcam sending.
    13.        // Dont call this if its just one image, call CmdSendBytes(dataArrayByte); direcrtly
    14.        InvokeRepeating("RepeatSend", 1, sendInterval);
    15.    }
    16.  
    17.  
    18.    private void RepeatSend()
    19.    {
    20.        Debug.Log("RepeatSend");
    21.        CmdSendBytes(dataArrayByte);
    22.    }
    23.  
    24. // note sending unreliably limits you to 1199 bytes per message.  [Command(channel = Channels.Unreliable)]
    25. // send reliably to go past the 1199 bytes limit, however this may clog up your channels
    26. // reliable also breaks up and pieces back together large sent sizes, where as unreliable channel does not
    27.    [Command]
    28.    private void CmdSendBytes(byte[] _value)
    29.    {
    30.        Debug.Log("CmdSendBytes");
    31.        RpcSendBytes(_value);
    32.    }
    33.  
    34.    // "includeOwner" player should apply their own data, and not wait to send and recieve it back
    35.    // [ClientRpc(channel = Channels.Unreliable,includeOwner = false)]
    36.    [ClientRpc(includeOwner = false)]
    37.    private void RpcSendBytes(byte[] _value)
    38.    {
    39.        //convert bytes and apply result to plane
    40.        Debug.Log("RpcSendBytes");
    41.    }
    42. }
     
    mischa2k and dhhdumi like this.
  39. dhhdumi

    dhhdumi

    Joined:
    Aug 3, 2019
    Posts:
    5
    Thank Sir
     
    jesusluvsyooh likes this.
  40. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Yes. Use the telepathy transport, it can send up to 2GB if you allow it to (configure in inspector).
     
    dhhdumi likes this.
  41. DogaCanKilic

    DogaCanKilic

    Joined:
    Oct 14, 2020
    Posts:
    2
    Hello. Can I listen multiple ports on same IP using the network discovery? Currently when I host a multiple server on the same machine, It lists only one of them.
     
  42. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Mirror 66.0.9 pushed to Asset Store!

    We've also updated our Sponsors page:
    https://github.com/sponsors/vis2k



    Please consider sponsoring so we can focus on Mirror full time!
     
  43. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    Hello the latest asset store Mirror says you must have Unity 2020 although your website says you only need 2019 LTS. Is there a way to download a previous version that works with Unity 2019?

    Also in the description it says 2019LTS, but when I try to download the asset it says it requires 2020.

    The reason is I am making a VR game and I've been told Unity 2019 LTS is the most stable version to use with VR.

    Secondly, is there any news about if the Oculus transport layer might get updated? It says "not ready for production" but it looks usable.
     
  44. mischa2k

    mischa2k

    Joined:
    Sep 4, 2015
    Posts:
    4,347
    Just open it with Unity 2019. It's fine.
    You could take over the oculus transport and maintain it if you are going to use it for your game.
    That's how most transports work, other than kcp which is supported by Mirror's dev team.
     
    yoonitee likes this.
  45. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    OK. Well I might have to get it from Github then, because the Asset Store won't let me import it into Unity 2019
     
  46. Gamemakers3D

    Gamemakers3D

    Joined:
    Dec 8, 2020
    Posts:
    31
    assetstore today Version 66.0.9, but yes newest 67.0.3+ here:
    https://github.com/vis2k/Mirror/releases
     
    yoonitee likes this.
  47. Gamemakers3D

    Gamemakers3D

    Joined:
    Dec 8, 2020
    Posts:
    31
    Mirror/Sample of Tanks, runs in Local Net Multiplayer with WebGL 2 Clients, played today using Edge/Chrome, win11
    hosting on UnityEditor 2021, LAN 192.168.0.10 and LIKE it, you see here Tanks are 2 Lan Net WebGl client browsers: using Mirror newest 67.0.3+ here:https://github.com/vis2k/Mirror/releases
    no extra gzip, no python, no node, just Unity3d 2021 and accepted firewall public+private on win10+ TanksMirrorNetLanWebGL.jpg
     
    Last edited: Apr 22, 2022
    yoonitee and Willbkool_FPCS like this.
  48. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    Thanks, I downloaded the Mirror 67.03. And opened it in Unity 2019 LTS.
    Then I downloaded the Oculus P2P transport layer. Which, after renaming a few things it works. Fine.
    I have been able to work the Tanks example and have a multiplayer experience between a test user in Unity editor and the Oculus headset. :D And because it is using the Oculus transport layer it means that I would have to pay for bandwidth. I am sounding like this lol.
     
  49. yoonitee

    yoonitee

    Joined:
    Jun 27, 2013
    Posts:
    2,363
    Hello, I tried to understand your post but failed :(. Are you just saying you're happy because you got the tanks example to run in a browser? Sorry for my ignorance.
     
  50. Gamemakers3D

    Gamemakers3D

    Joined:
    Dec 8, 2020
    Posts:
    31
    Free webpage+multiplayer mirror hosting for webgl from unity3d editor (uncomplicated:similar to unet) while disable gzip, you can build and run it in multiple webgl browsers/devices, and join all to play together from hosting unity3d editor+review map/stats. And of course customize videogames to simpleTcpSickets at NetTransport for webgl games, just add that class and select it, instead kcp/udp. WebRtc could be a webgl with udp, to try/ reply.