question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Suggestion] Remove entities with no components

See original GitHub issue

Right now it is possible to remove all components on an entity and have a blank component-less entity orphaned in the pool. What do you think of adding a check on component removed that removes the Entity if it has no remaining components?

I have a few place in my code handling manual cleanup, but it would be really nice to have this handled by Entitas. I could see this having an issue with the OnComponentRemoved callback, but there may be a way to work around that.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:23 (17 by maintainers)

github_iconTop GitHub Comments

3reactions
sschmidcommented, Jun 14, 2016

I was reading through the discussion again, but I still have the points in my head that I made earlier. I think your solution with a custom cleanup system as a last system in your list could solve this.

And yes, there is a way for having one system for multiple pools (pretty new feature): See AnimateDestroyViewSystem.cs

1reaction
sschmidcommented, Jun 14, 2016
Read more comments on GitHub >

github_iconTop Results From Across the Web

[Suggestion] Remove entities with no components #117
Right now it is possible to remove all components on an entity and have a blank component-less entity orphaned in the pool.
Read more >
How to remove unavailable entities? - Configuration
I searched google, but can not find a solution to remove them? it says: “Deze entiteit heeft geen unieke ID” (This entity has...
Read more >
Learning Entity-Component System. Deleting ...
To kill an entity, put into a kill bin/tag it/whatever, and after every frame or kill cycle, remove the components for each entity...
Read more >
Efficient removal and adding of Components in ECS
So, i figured out how to do it quick and dirty, i subclassed Array (libGDX.util) to allow for faster removal of Entities and...
Read more >
Remove ComponentType from all entities?
Hello, I was wondering what the best way to remove a single component type from all entities that have it. Here's my use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found