Since official wants to change game object land physics component as default authoring, I would like official to make Layer Override able to access at Monobehavior so I can serialize it to do my custom authoring that like PhysicsCategoryTag that can pick BelongsTo and CollidesWith from inspector without required to add the entire game object land physics component. I have use case that just want to bake CollsionFilter into component without physics collider. I requested this feature since May and will official release this feature very soon at near editor release together with dots 1.1 release?
#Request for game object land physics Layer Override public access
1 messages · Page 1 of 1 (latest)
Hi @bleak spade , we have this exact feature in our pipeline. Unfortunately I can not tell you exactly with what release we would be providing this solution at the moment. I am very sorry about that.
🤔 I see but I guess it will only available at 2023.3 and will never release at 2022.3 LTS?
Given that this simply does not work, I see this as a bug which can be fixed in any already released version of the Unity Physics package. The issue likes in the physics package alone and therefore does not require any Unity main codebase changes.
So, to give you an example, this could make it into a 1.1.X release of Unity Physics even after the 1.1 release is already public.
Again, unfortunately I can not guarantee any version in which this would be relased with but we do understand that this is a pain point and is a required part for replacing the Physics Shape authoring with the built-in collider authoring.
Consequently, we do see this as a higher priority bug fix.
🤔 Wait. I thought those game object land collider like Box Collider is at engine side that needs to do changes at editor? Basically what I wish to have is able to put public LayerOverrides layerOverrides into my custom authoring baker script and it can serialize exactly like box collider that I can configure layer ovrride priority, include layers and exclude layers
I can see how this might appear that way. But what we need to funnel the information from these built-in authoring components into the Unity Physics engine is already present: it's the authoring data properties themselves, such as the layer overrides information.
What happens is that the entity data bakers for these components (which sit entirely inside the Unity Physics package) read these data properties and carry them into the engine to create the desired rigid bodies and colliders.
If you want to use layer overrides yourself, you can already do that exactly as you describe with an additional authoring component which simply adds the required information to the baking data.
For an example of how this is done you could check out the custom authoring sample in the package which we also auto-include in the PhysicsSamples project.
What I want is just make LayerOverrides to become public instead of private currently then I can access it at my authoring baker to bake the data into CollisionFilter component. Then I can use CollisionFilter to something OverlapSphere
Let me check. You should be able to read this data within a baker.
This require 1 line C# side interop engine changes to make it works I believe
I am not sure exactly what you mean here regarding accessibility. Let me check it out.
Here you can see that the layer override data provided in the built-in collider authoring components are accessible publicly. So you should be able to write a baker that grabs that data and simply funnels it into the Unity Physics baking process already.
I just added these variables at the top to illustrate that from within a baker (that function here is inside a baker for the BoxCollider) the data is accessible.
I expect something like this but it doesn't work
What I want to achieve is able to access LayerOverrides directly without require to add any game object collider into game object as authoring
Can you use LayerMask instead?
That's what is exposed in the built-in colliders, e.g., the BoxCollider.
See my screenshot above
You could just add these as serializable properties to your component and then funnel the information over to the Unity Physics entity through baking and add CollisionFilters with the corresponding bit masks to the colliders you are creating.
🤔 I see. So Include layer and Exclude layer basically just using LayerMask but is that official going to stick with LayerMask instead of creating dedicated physics layer?
For now we will be using the data and authoring workflows that are already in place in the built-in authoring components.
We have been talking about having dedicated physics layers, but that might be something that we don't address in the short term.
We do understand the fact that the layers are getting crowded since they are not only used for physics.