Toggling Gravity in Mesh Link Traversal: "Structural Changes are not allowed while iterating over entities. Please use EntityCommandBuffer instead."

We’re trying to setup a link to make an agent traverse a graph, however due to the way gravity is toggled on FollowerEntity it doesn’t like it and spits out the following:

Structural Changes are not allowed while iterating over entities. Please use EntityCommandBuffer instead.

This is due to it trying to Add/Remove the Gravity ECS component for enableGravity during ECS iteration (probably due to it being in the mesh link?). Is there any quick way to fix this so we can toggle gravity at run time? EntityCommandBuffers look… un-fun.

We’re on 5.0.4 right now.

Thanks. I’ll change this to an enableable component in the next update, which makes it a non-structural change.

1 Like