Search Unity

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

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Bug NativeList NativeHashMap not found?

Discussion in 'Scripting' started by SuperFranTV, Nov 24, 2021.

  1. SuperFranTV

    SuperFranTV

    Joined:
    Oct 18, 2015
    Posts:
    110
    Hello,

    iam added the Collections Package, now in my Script iam add

    "using Unity.Collections;" but only NativeArray is available?

    What can i do?
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    The DOTS forums are here.
     
  3. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,699
    As far as I'm aware those collections are for entities only (ECS). So when you do a non-ECS project you are probably out of luck.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    No, the "com.unity.collections" package only has dependencies on "com.unity.burst" and "com.unity.test-framework" so will work fine without "com.unity.entities" etc.

    The above looks like that package wasn't added correctly or at all. Maybe too recent a version of Unity is used.
     
  5. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,699
    Hm, maybe this thread helps. Especially the last entry.

    Edit: just found where I've read that: https://docs.unity3d.com/Manual/JobSystemNativeContainer.html
    So to me that sounds ECS only.
     
  6. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    I cannot comment on those old docs (this isn't even my area in Unity) however note that there's also no such thing as "the ECS package" either and that DOTS probably wasn't even a thing then. Maybe this was when they were situated there, not sure. All this should be resolved upon release of the DOTS system as a whole.

    The Unity.Collections package is where they are and the dependencies I stated above are correct. You can use them for Jobs independent of Entities, just like you can Burst.

    https://docs.unity3d.com/Packages/com.unity.collections@1.1/manual/index.html
     
  7. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,699
    I would not consider 2020.3 "old" since this is the current LTS release. But you see how difficult it is to stay up to date and how UT "manages" their package releases can be irritating.
    Anyway. I read that at some point in the past and thought it could be source of OP's issue.

    2020.3 is the official version ECS projects shall use since is there is some unexplained "incompatibility" in newer versions. And the package is named "entities".

    Can you give an ETA for that? ;) Just kidding. This may still take years from the current looks of it.
     
  8. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    Old in relation to DOTS. I'm not making any statements here. DOTS was pulled back from the public view to be worked on for stability. All I'm saying is that this was some of the first offering of docs, not trying to pull you up on you linking to them. Just saying it's moved forward since then, mostly offline.

    I looked at the collections package manifest. It states the dependencies I said above so no "ECS" (entities package) dependency at all. It doesn't matter what the docs says is all I'm saying sir, I'm passing along 100% accurate info is all.

    I'm honestly not in the loop, no really. All I'm trying to do is dispassionately pass along useful information. :)
     
  9. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,699
    I don't want to reiterate on my statement or tell you are wrong (I believed you as soon as you posted it). I just wanted to explain why I came to the wrong conclusion. So no worries from my side. Just an explanation/excuse for me giving wrong information. There is no doubt that you are way more credible ;).

    It was a joke. It's unlikely when there is a news embargo you are the one who "leaks" it. My remark should just remind UT how frustrating it is to be kept out. And I also know it's not your fault. So no worries here too.

    Anyway. I hope got his problem solved.
     
  10. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    Oh I wouldn't go that far, don't take things to the extreme! :p

    Here neither. I've got thick skin sir regardless! Comes from being an "old" dev. ;)

    Me too and sorry for hijacking the thread somewhat. I ask other devs not to do that so I'll go sit in the naughty corner or perhaps just go back and get on with my annual leave!
     
    Lurking-Ninja and exiguous like this.
  11. SuperFranTV

    SuperFranTV

    Joined:
    Oct 18, 2015
    Posts:
    110
    Thank you for answers, it tested 3 hours, i found the Solution :D

    Solution: Reimport full Project, reopen it and the collection classes are loaded.
     
    LethalByte, MelvMay and exiguous like this.
  12. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    6,919
    Glad you got it working and sorry for the noise on my part. ;)
     
  13. LethalByte

    LethalByte

    Joined:
    Mar 27, 2019
    Posts:
    1
    Thank you. I have been struggling with this issue for a while now myself and you're solution worked for me too.
     
    SuperFranTV likes this.
unityunity