Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved I cant use the Unity.Netcode.Spawning namespace

Discussion in 'Netcode for GameObjects' started by samooz, Dec 15, 2021.

  1. samooz

    samooz

    Joined:
    Jun 22, 2021
    Posts:
    1
  2. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    The docs are outdated. `using Unity.Netcode;` is the only namespace you need. Instead of `MLAPI.NetworkManager.ConnectionApprovedDelegate` use just `NetworkManager.ConnectionApprovedDelegate`
     
    SirRell likes this.
  3. MemzDev

    MemzDev

    Joined:
    Sep 7, 2020
    Posts:
    2
    that doesnt work it gives me this error: CS0426 The type name 'ConnectionApprovedDelegate' does not exist in the type 'NetworkManager'
     
  4. RikuTheFuffs-U

    RikuTheFuffs-U

    Unity Technologies

    Joined:
    Feb 20, 2020
    Posts:
    440
    @MemzDev what version of Netcode For GameObjects are you using? 1.2.0 is the latest
     
  5. hd1

    hd1

    Joined:
    May 3, 2015
    Posts:
    13
    I just updated the netcode package and since then I have gotten this error:

    Assets/NetCode/Tests/Manual/Scripts/ConnectionApprovalComponent.cs(157,98): error CS0426: The type name 'ConnectionApprovedDelegate' does not exist in the type 'NetworkManager'

    I haven't modified them and I can't find what is wrong with this. I am using version 1.2.0.

    Any help would be appreciated.
     
  6. hd1

    hd1

    Joined:
    May 3, 2015
    Posts:
    13
    Alright I think I found the solution, for some reason it had installed netcode twice in my project and then there was a version mismatch error.