Skip to content

Conversation

@Princess-Cheeseballs
Copy link
Member

SetTiles has RegenerateCollisions() happen before TileChangedEvent is raised.

TileChangedEvent is used to unanchor and unparent entities on the grid.

RegenerateCollisions will delete the grid and everything parented to it, if there are no tiles left.

This means if all tiles on a grid are destroyed simultaneously, all entities on that grid get deleted with no chance to save themselves. This doesn't happen with the normal SetTile method, just this one.

I swapped the other these methods execute to fix the bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant