ConvertToEntity bug ?

Play around with entities 0.2.0-preview.18, ConvertToEntity’s Convert And Inject GameObject is not working now, Gameobjects are always destroyed

For those that don’t want to read through everything of the link posted above (as most of it is not relevant for this specific problem) here’s what they say there:

This is indeed a bug, and not working normally.

However, there is a workaround. Since the bug only seems to happen with root object, and we can use that fact to work around the problem:

  1. Create a new root object with a “Convert to Entity” component set to “Convert and Destroy”
  2. Add your current object (with their “Convert to Entity” set to “Convert and Inject”) as children to this root object

Voila, it should work again then.

In your Hierarchy it will look something like:

5210888--518756--upload_2019-11-25_15-24-46.png

Where player used to be just a root object, but now is a child of this new parent object. I named it specifically like that so I know it’s there for a workaround.

This new parent object is very simple:

5210888--518759--upload_2019-11-25_15-25-47.png

The player looks like this:

5210888--518762--upload_2019-11-25_15-26-23.png

When going into play mode the parent object will be destroyed, but the children will then become root objects. And everything should work like before. I haven’t tested this a lot yet, but at first glance it seems to work.

2 Likes

Thank you

Thanks for reporting the issue, the regression has been fixed in the upcoming package update.

6 Likes

It’s fixed in Entities 0.3.0 package