Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColliderMesh with collider layer = NONE #419

Merged
merged 1 commit into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions content/creator/sdk7/3d-essentials/colliders.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ You can configure a `MeshCollider` component or the `GltfContainer` component to
- `ColliderLayer.CL_CUSTOM1` through to `CL_CUSTOM8`: Can be used together with raycasts, so that a ray only detects collisions with one specific layer.
- `ColliderLayer.CL_NONE`: Doesn't respond to collisions of any kind.

{{< hint warning >}}
**📔 Note**: To disable collisions form a `MeshCollider` component, delete the component. Do not set the collision layer to `ColliderLayer.CL_NONE`. There's a known issue with the `MeshCollider` component. Instead of disabling all collisions, it makes this value equivalent to the default (`ColliderLayer.CL_PHYSICS | ColliderLayer.CL_POINTER`).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ColliderLayer.CL_NONE should work as expected

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this a bit over Slack but I'll bring some context here for the record:
I created an issue here: #418
"The technical explanation: CL_NONE enum value is 0, which is bitwise-treated the same as not having a ColliderLayer defined, which defaults to CL_PHYSICS & CL_POINTER."

A potential fix would be to change the enum value, but that would require more development time, in the mean time I think this warning is enough to be clear to creators that this is a known issue, what do you think @gonpombo8 ?

{{< /hint >}}

```ts
// create entity
const myEntity = engine.addEntity()
Expand Down
Loading