Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug NetworkBehaviour Singleton error

Discussion in 'Netcode for GameObjects' started by BraniDev, Jul 27, 2023.

  1. BraniDev

    BraniDev

    Joined:
    Aug 3, 2019
    Posts:
    25
    Hi i installed package Netcode for GameObjects 1.2.0 and try out 1.4.0 as well but with same bug.
    when i create this :
    NetworkBehaviour.Singleton.StartHost();
    then under Singleton is error " NetworkBehaviour does not contain a definition for 'Singleton'.
    In the Course i watch is working just fine, but for me for i don't know what reason is not working and i don't know how to continue, what i am doing wrong?
    Thank you.
     
  2. tleylan

    tleylan

    Joined:
    Jun 17, 2020
    Posts:
    614
  3. lavagoatGG

    lavagoatGG

    Joined:
    Apr 16, 2022
    Posts:
    226
    Instead
    NetworkBehaviour.Singleton.StartHost();

    try:
    NetworkManager.Singleton.StartHost();
     
  4. BraniDev

    BraniDev

    Joined:
    Aug 3, 2019
    Posts:
    25
    Omg i was totally blind yesterday thank you very much!
     
    lavagoatGG likes this.