#Request for game object land physics Layer Override public access

1 messages · Page 1 of 1 (latest)

bleak spade
#

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?

humble patio
#

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.

bleak spade
humble patio
#

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.

bleak spade
humble patio
#

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.

bleak spade
humble patio
#

Let me check. You should be able to read this data within a baker.

bleak spade
#

This require 1 line C# side interop engine changes to make it works I believe

humble patio
#

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.

bleak spade
#

What I want to achieve is able to access LayerOverrides directly without require to add any game object collider into game object as authoring

humble patio
#

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.

bleak spade
humble patio
#

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.