"InvalidOperationException: The entity does not exist" when converting GO with CapsuleCollider

There are a few objects in the scene that if a Convert To Entity component is added the error pops up:
InvalidOperationException: The entity does not exist

It seems to be caused by the game object having a capsule collider on it because when removed this error goes away.

Does anyone know the root cause?

You have Unity.Physics installed? What happens when you add a Physics Shape?

1 Like

Yes, Unity.Physics is installed. I’ve been developing on this project for some time now, and it wasn’t happening before which is why I’m having trouble finding the cause.

I’ve tried adding the Physics Shape, Physics Body, nothing seems to make a difference besides moving the game object to the root of the scene, which makes me think it has something to do with the game object being a child or something to do with one of its parents.

From the instances I’ve encountered this problem, it has solved it by making the game object at least 2 steps away from the root of the scene, or in other words, not being nested deeper than the game object having a parent which has a parent. But I still would like to understand what is causing this problem.

During conversion all the Colliders are unparented. Are you trying to access the children that do not exist anymore after the unparenting?

1 Like

Just to clarify: The colliders are removed from the gameobjects and set to null parent upon conversion with Convert And Destroy. I Assumed this did not happen with Convert and Inject. Is that incorrect?

And would that be referring to the GameObjects and not the Entity?

The part I am confused about is moving the same GameObject to a different Parent changes the behavior. If on a parent 2 levels deep it seems to be fine but 3 or more seems to throw the error. Neither parent is being converted if that makes a difference.