I have an unexpected behaviour regarding the Physics Body GO component. I have a Physics Body component on a vehicle that causes it to drop due to its PhysicsMass ECS component.
When I start the game with a disabled Physics Body GO component, my assumption was that it would not convert to a PhysicsMass ECS component, but it does (see first half of the GIF). Only when I remove the PB GO component is the ECS component not created (second half of the GIF).
Is my assumption correct in that it should not create an ECS component for its entity?
Cheers and thanks in advance
P.S: I’m aware that this could as well go into the DOTS forum, but I think the physics authoring components are managed by people reading this forum.
P.P.S: Never mind the weird colors when the game runs, that is an issue with the URP that I have yet to figure out.
Yes that is weird. That setup should not result in a PhysicsMass component being created.
FWIW I just tried the same thing here in the sample scenes and it behaves as expected.
Agreed, this is weird. Would it be possible to get a repro of your scene running in the Samples project?
Making stuff up of the top of my head here: Is this a prefab in the inspector, while we are looking at an instance with the enable flag overriden? Is there a parent GO with another Physics Body component? Do you have your own conversation system in operation? Is the prefab a dependency on a script somewhere else that converts it first?
Is the graphics material using a ShaderGraph? If so, you might want to try disabling GPU instancing as a short term fix. We had that issue on the samples when we moved to 2019.3.x
Thanks to both of you for confirming that a PhysicsMass ECS component should not be created.
I forgot letting you know the Unity version. It’s 2020.1.0a11 on OS X.
To answer @steveeHavok 's questions (starting from the 2nd):
It’s an instance of a prefab. The Physics Body component is disabled while in the prefab (not visible) it’s enabled.
No, this is the top level GO with the Physics GO component.
I have some conversion systems, but not for Physics GO components – I use the Convert To Entity GO component.
Not sure what that exactly means – I use conversion scripts to convert some of my own authoring components.
To test this I now tried with a fresh project – and started with a non-prefab cube and a prefab cube. Both have this issue (GIF with the same procedure as in the last GIF):
I am slightly confused as to which sample scene/Samples project you are talking about. Should I submit the new project depicted in the GIF as a case?
Re the shader graph question:
I was using a standard URP lit material with textures on it, no special shader graph (by me).
In the GIF above, I am using the default URP Lit shader with no textures, and disabled GPU instancing.
Please let me know if there’s anything I can provide to help.