Looking for somthing similar to .WithChangeFilter<>() but for removed components

Hello everyone,

my code is heavily based on reactions for component changes. WithChangeFilter<>() works great for adding and changing components. But it obviously doesn’t work for removed components

Is there a way to detect remove of a component? Maybe something like this

            Entities
                .WithAll<Item>()
                .WithNone<IsActive>()
                .WithRemoveFilter<IsActive>()
                .ForEach((int entityInQueryIndex, Entity entity) =>
                {
                    ....
                })
                .WithStructuralChanges()
                .Run();

I am aware of ISystemStateComponentData, but I am looking for more elegant solution

You’ll need a reactive system for that :

@WAYNGames Thank you for the advice

1 Like

Try this one https://discussions.unity.com/t/810333

Sure, I’ll take a look. Thank you!