NEON-29: Fix player–world collision pairing (env mask includes layer 2)
Player uses collision_layer 2 so camera pick rays (mask 1) skip the capsule. Static bodies defaulted to collision_mask 1, so they never scanned layer 2 and Godot produced no floor/wall contacts—walk appeared stuck with is_on_floor false. Set collision_mask=3 on all NavigationRegion3D StaticBody3D walkables and occluders; bumps inherit from Floor at spawn. Document the pairing in README.pull/41/head
parent
cb001a9369
commit
ae66b6b313
|
|
@ -98,7 +98,7 @@ The main scene includes a **prototype terminal** at the map center (same world *
|
|||
|
||||
**`player.gd`** uses **`NavigationAgent3D.get_next_path_position()`** + **`move_and_slide()`** for horizontal motion when following the mesh; it may steer **directly at the goal** in xz when the descend bypass applies (NEON-8). **`snap_to_server()`** remains for **boot** (and would apply for any future hard reconcile).
|
||||
|
||||
- The avatar is on **physics layer 2** with **mask 1** (floor + obstacle on layer 1); the pick ray uses **mask 1** so clicks pass through the avatar and hit the floor.
|
||||
- The avatar is on **physics layer 2** with **mask 1** (it scans walkables on layer **1**). Environment **StaticBody3D** nodes stay on **collision_layer** **1** but use **collision_mask** **3** (layers **1** and **2**) so they also scan the player layer—otherwise Godot never pairs the capsule with the floor and **`is_on_floor()`** / **`move_and_slide()`** contacts break. The pick ray uses **mask 1** so clicks pass through the avatar and hit the floor.
|
||||
|
||||
### Manual check (remnants)
|
||||
|
||||
|
|
|
|||
|
|
@ -147,6 +147,7 @@ fov = 50.0
|
|||
navigation_mesh = SubResource("NavigationMesh_district")
|
||||
|
||||
[node name="Floor" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1800743112 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/Floor" unique_id=152652175]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0)
|
||||
|
|
@ -157,6 +158,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.1, 0)
|
|||
shape = SubResource("BoxShape3D_floor")
|
||||
|
||||
[node name="PrototypeTerminal" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1700001 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/PrototypeTerminal" unique_id=1700002]
|
||||
|
|
@ -167,6 +169,7 @@ surface_material_override/0 = SubResource("Mat_terminal")
|
|||
shape = SubResource("BoxShape3D_terminal")
|
||||
|
||||
[node name="MoveRejectPedestal" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1900021 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 7.5, 0, -6.5)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/MoveRejectPedestal" unique_id=1900022]
|
||||
|
|
@ -179,6 +182,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.25, 0)
|
|||
shape = SubResource("BoxShape3D_move_reject_pedestal")
|
||||
|
||||
[node name="MoveRejectFarPad" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1900031 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9, 0.06, 9)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/MoveRejectFarPad" unique_id=1900032]
|
||||
|
|
@ -189,6 +193,7 @@ surface_material_override/0 = SubResource("Mat_move_reject_farpad")
|
|||
shape = SubResource("BoxShape3D_move_reject_farpad")
|
||||
|
||||
[node name="Obstacle" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=1638845763 groups=["occluder"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 6, 0, 5)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/Obstacle" unique_id=750473628]
|
||||
|
|
@ -200,6 +205,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|||
shape = SubResource("BoxShape3D_obstacle")
|
||||
|
||||
[node name="ObstacleB" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000001 groups=["occluder"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -10, 0, 5)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/ObstacleB" unique_id=3000002]
|
||||
|
|
@ -211,6 +217,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, 0)
|
|||
shape = SubResource("BoxShape3D_obstacle_b")
|
||||
|
||||
[node name="ObstacleC" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000004 groups=["occluder"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 5, 0, -12)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/ObstacleC" unique_id=3000005]
|
||||
|
|
@ -222,6 +229,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 2, 0)
|
|||
shape = SubResource("BoxShape3D_obstacle_c")
|
||||
|
||||
[node name="ObstacleD" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000007 groups=["occluder"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8, 0, -16)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/ObstacleD" unique_id=3000008]
|
||||
|
|
@ -233,6 +241,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0)
|
|||
shape = SubResource("BoxShape3D_obstacle_d")
|
||||
|
||||
[node name="TerracePlatformA" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000010 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13, 0, -14)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/TerracePlatformA" unique_id=3000011]
|
||||
|
|
@ -245,6 +254,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.15, 0)
|
|||
shape = SubResource("BoxShape3D_terrace_a")
|
||||
|
||||
[node name="TerraceStepB" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000013 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, 8.5)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/TerraceStepB" unique_id=3000014]
|
||||
|
|
@ -257,6 +267,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.15, 0)
|
|||
shape = SubResource("BoxShape3D_terrace_b_step")
|
||||
|
||||
[node name="TerracePlatformB" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000016 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -15, 0, 13)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/TerracePlatformB" unique_id=3000017]
|
||||
|
|
@ -269,6 +280,7 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.3, 0)
|
|||
shape = SubResource("BoxShape3D_terrace_b_platform")
|
||||
|
||||
[node name="TerracePlatformC" type="StaticBody3D" parent="World/NavigationRegion3D" unique_id=3000019 groups=["walkable"]]
|
||||
collision_mask = 3
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, 14)
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="World/NavigationRegion3D/TerracePlatformC" unique_id=3000020]
|
||||
|
|
|
|||
Loading…
Reference in New Issue