#What ways could a late ECB playback on a destroyed entity be prevented?

1 messages · Page 1 of 1 (latest)

calm swan
#

I have 2 systems(TankTireSystem and TankWeaponEffectEventSystem), they both operate on the same entity, however TankWeaponEffectEventSystem seem to destroy the entity with an ECB before TankTireSystem's ECB sets a component to the entity(at least this is what I assume is happening bts).

This is the exception thrown in reference:

EntityCommandBuffer was recorded in TankTireSystem and played back in Unity.Entities.BeginSimulationEntityCommandBufferSystem.```

I use a component lookup for LocalTransform and I check if it gets an entity before modifying it and setting its modified value via ECB but it seems that TankWeaponEffectEventSystem destroys the entity right after my component lookup job is scheduled but before its ECB could playback.
runic ingot
#

stop using ecb for setting any values, set them right in place during job via ref access to component

royal frost
#

you can rework ecb usage into just main thread system that does the same