feat: sdk collision layer main player#8865
Draft
pravusjif wants to merge 1 commit into
Draft
Conversation
sandrade-dcl
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the
CL_MAIN_PLAYERcollider layer (replaces the unusedCL_RESERVED2) and unifies howRaycastandTriggerAreatreatColliderLayermasks for the local player avatar.What changed
CL_MAIN_PLAYER(value8) — targets the local player avatar specifically.CL_PLAYERandCL_MAIN_PLAYER; remote avatars carry onlyCL_PLAYER.RaycastandTriggerAreanow use the same constantPLAYER_QUALIFYING_BITS = CL_PLAYER | CL_MAIN_PLAYER.CL_PHYSICS,CL_POINTER,CL_CUSTOM*, andCL_NONEno longer hit / fire on the local player.MeshCollider/GltfContainer— masks containingCL_PLAYERorCL_MAIN_PLAYER(withoutCL_PHYSICS) now route to a new dedicated Unity layerSDKAvatarHit: raycast- and trigger-detectable, but the player capsule walks through (previously the collider was silently disabled). Mixing inCL_PHYSICSkeeps the mesh solid against the player.CL_MAIN_PLAYER-only trigger now skips remote-avatar overlaps inside the MonoBehaviour via the existingTargetTransformearly-out.AllAvatars→SDKAvatarTriggerArea— the layer slot (18) is unchanged, only the name changes. The old name was misleading (no avatars actually live on that layer; it hosts the avatar-targeting TriggerArea collider). Pairs cleanly with the existingSDKEntityTriggerAreaname. C# constant renamedPhysicsLayers.ALL_AVATARS→PhysicsLayers.SDK_AVATAR_TRIGGER_AREA.Behaviour comparison
BEFORE
CL_PLAYERCL_PHYSICSCL_POINTERaloneCL_CUSTOM*aloneCL_NONEThe two systems disagreed on every mask except
CL_PLAYER. (CL_MAIN_PLAYERdid not exist.)AFTER
CL_PLAYERCL_MAIN_PLAYERCL_PLAYER | CL_MAIN_PLAYERCL_PHYSICSCL_POINTERaloneCL_CUSTOM*aloneCL_NONEThe two systems now agree on every mask.
Migration note
Scenes that previously relied on
CL_PHYSICSraycasts to detect the local player must nowORCL_MAIN_PLAYER(orCL_PLAYER) into their mask. Walls-and-floors physics checks that do not target the player are unchanged.Related PRs