.foreach limitation of only 9 components?

A weird question: Is there a limit to 9 components to a .foreach? This could help my design of my system architecture. I want to limit how many variables in each component due to the write cost of many when reassigning entire structs, yet at the same time if only 9 components allowed, I need to push extra data into related structs… This is a loss of organization and a puzzle challenge if cramped into 9 components. I could see myself commonly using 15+ if allowed.

I’m making a system architect design decision in the dark by just assuming we’re cramped to 9 components for some reason. I’d love to know the truth about this so if there is a way to get many components in a .foreach I can revert my design before it really gets ugly amalgamating structs together.

Thanks,
Jim

You can use more than 9, but if you do, you need to declare custom delegate signatures.

Take a look at the custom delegates section here to learn about it:
https://docs.unity3d.com/Packages/com.unity.entities@0.17/manual/ecs_entities_foreach.html

1 Like

Thank you ShinyClef.