decentraland / sdk

PM repository for SDK
Apache License 2.0
4 stars 4 forks source link

GLTF collision mask option for both #1104

Closed nearnshaw closed 1 week ago

nearnshaw commented 5 months ago

In the GLTF component, in the Visible Layer and Invisible Layer fields we have a dropdown of options that include Pointer and Physics, but there is no way to set BOTH Pointer AND Physics in one same layer.

It's a pretty common thing to want either the visible or the invisible geometry to be both for physics and for pointer events. Today you need to only chose one.

Image

The same happens with the MeshCollider component:

Image

From the code side, it's perfectly possible to assign both. It shouldn't be hard to add. https://docs.decentraland.org/creator/development-guide/sdk7/colliders/#collision-layers

MeshCollider.setBox(
  myEntity,
    ColliderLayer.CL_PHYSICS |
    ColliderLayer.CL_POINTER
)

One could argue that if we do this we should also do all the combinations between "Custom" layers, that are way too many. But I disagree, the Custom layers are a very advanced feature, rarely used, and if you're also capable of using code to edit the collision layers of your items. Wanting both Physics and Pointer is a common beginner-level scenario that should be easy.