Search Unity

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

Bug FindObjectsOfTypeError

Discussion in 'Netcode for GameObjects' started by Joel200955, Oct 25, 2023.

  1. Joel200955

    Joel200955

    Joined:
    Apr 6, 2022
    Posts:
    2
    Library\PackageCache\com.unity.netcode.gameobjects@1.7.0\Runtime\Core\NetworkObject.cs(76,34): error CS0103: The name 'FindObjectsByType' does not exist in the current context
    The only thing I have done is add netcode for game objects to a new 2d project.
     
    dan_ginovker likes this.
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,976
    What editor version? FindObjectsByType isn't in all of them, it's in 2020.3 and 2021.3 but not 2021.1 for instance.

    Manual says v1.6 is the version for Unity 2022.3. I can imagine v1.7 may be for 2023.x or it has some compatibility issue.
     
  3. Joel200955

    Joel200955

    Joined:
    Apr 6, 2022
    Posts:
    2
    I'm using version 2021.3.6f1 but i'll try another version.
     
  4. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    4,976
    Yeah definitely upgrade to the latest patch version at least, since version .6f1 is about 33 patch updates behind. ;)
     
  5. dan_ginovker

    dan_ginovker

    Joined:
    Jun 13, 2021
    Posts:
    76
    Updating to the latest version of 2021.3.x fixed it for me
     
  6. KeenanDavis

    KeenanDavis

    Joined:
    Nov 14, 2023
    Posts:
    1
    Thanks for letting me know how you fixed this error. I will try it too.
     
    Last edited: Nov 22, 2023
  7. Overy1976

    Overy1976

    Joined:
    Dec 1, 2023
    Posts:
    1
    Have you successfully fixed the error?
     
  8. AsgarraRu

    AsgarraRu

    Joined:
    Nov 27, 2020
    Posts:
    1
    Updating the editor from 2021.3.6f1 worked for me as well
     
  9. coperli

    coperli

    Joined:
    Jan 26, 2024
    Posts:
    1
    • Confirm Netcode Compatibility: Verify that the Unity Netcode version you're using is compatible with your Unity Editor version. Consult the Netcode documentation for supported versions. sod gold
     
    Last edited: Jan 29, 2024