Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Third Party Mirror could not be found in scripts but loaded in project

Discussion in 'Multiplayer' started by drulz, Feb 18, 2022.

  1. drulz

    drulz

    Joined:
    Feb 21, 2015
    Posts:
    29
    My environment
    Unity 2021.2.11f1
    using
    Mirror 57.0.0

    Like a good boy, i just imported Mirror to my project, create a little network manager and it works,
    now i wanted to create an override from a Network Manager and create my own but, just typong "using Mirror" in scripts, there are already errors
    so when i check the problem tab in VS Code i got these errors

    Code (CSharp):
    1. The type or namespace name 'Mirror' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]
    2. The type or namespace name 'NetworkManager' could not be found (are you missing a using directive or an assembly reference?) [Assembly-CSharp]
    3.  
    what i did was simply

    Code (CSharp):
    1. using System;
    2. using UnityEngine;
    3. using UnityEngine.SceneManagement;
    4. using Mirror;
    5.  
    6. /*
    7.     Documentation: https://mirror-networking.gitbook.io/docs/components/network-manager
    8.     API Reference: https://mirror-networking.com/docs/api/Mirror.NetworkManager.html
    9. */
    10.  
    11. public class MyNetworkManager : NetworkManager
    What am i lacking here?
     
  2. feyyd

    feyyd

    Joined:
    Apr 23, 2014
    Posts:
    8
    Same issue, I notice that Unity removes my reference to Mirror every time it goes back to Unity Editor, which I think is the cause.