fix: patrol navigation now first targets the closest point on the path

This commit is contained in:
Sara 2025-07-21 15:50:26 +02:00
parent 9517588415
commit c05d3aa28f
4 changed files with 20 additions and 14 deletions

View file

@ -394,23 +394,23 @@ transform = Transform3D(-0.866023, -0.433016, 0.250001, 0, 0.499998, 0.866027, -
shadow_enabled = true
[node name="PlayerBody" parent="." instance=ExtResource("1_6t4yh")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.0500376, 2.38419e-07, -0.0317376)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.039836764, -0.0014820099, 0.5135803)
slide_on_ceiling = false
[node name="NpcUnit" type="NpcUnit" parent="." node_paths=PackedStringArray("patrol_path")]
patrol_path = NodePath("../PatrolPath")
[node name="EnemyWretched" parent="NpcUnit" instance=ExtResource("3_7ng1a")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 0.017590523, 0.023196908, 3.073964)
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.68063784, 0.023195954, 3.1014705)
[node name="EnemyWretched2" parent="NpcUnit" instance=ExtResource("3_7ng1a")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -1.0904664, 0.023196908, 1.6584808)
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 1.2873832, 0.023196908, 3.055359)
[node name="EnemyWretched3" parent="NpcUnit" instance=ExtResource("3_7ng1a")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 1.1613213, 0.023196908, 1.513694)
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.2727146, 0.023196908, 4.665185)
[node name="EnemyWretched4" parent="NpcUnit" instance=ExtResource("3_7ng1a")]
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, -0.977286, 0.023196908, 4.202239)
transform = Transform3D(-1, 0, -8.742278e-08, 0, 1, 0, 8.742278e-08, 0, -1, 1.5723263, 0.023197861, 4.477292)
[node name="PatrolPath" type="PatrolPath" parent="."]