Search Unity

Resolved Too many SharedComponentData

Discussion in 'Entity Component System' started by charleshendry, Oct 25, 2020.

  1. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    I was hoping to add 4 shared components to most of my entities, but once I add the 4th, I get an error saying the max amount of 8 has been exceeded. There are already 5 being added by Unity.

    The 3 marked red are mine, the 5 yellow ones are from Unity. Am I able to remove some of them, e.g. is EditorRenderData related to the Live Link Mode (which I thought I'd tured off)?

    Or can I override the 8 component limit?

    chunkComponents.png
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,761
    You could edit the package and try increase the value of kMaxSharedComponentCount (which is hard coded to 8 and what limits it). I have no idea what is going to happen though. I'd say it's generally unwise to have so many shared components but you do you.
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,779
    Yep, I would also avoid using shared components.
    On the side note, is accessing them still can not be bursted?
     
    charleshendry likes this.
  4. charleshendry

    charleshendry

    Joined:
    Jan 7, 2018
    Posts:
    98
    Thanks guys. Not sure about bursted access but all I need them for is filtering by value with an entity query. Most of mine are hierarchical, so the "upper levels" don't create additional archetypes, i.e. there's no issues with chunk fragmentation. I think I'll change one of them to a tag component so I'm within the 8 limit and may remove others down the line if I run into issues.