diff --git a/player/npc/NpcVisual.gd b/player/npc/NpcVisual.gd index 1c4dafc..6f2ddd8 100644 --- a/player/npc/NpcVisual.gd +++ b/player/npc/NpcVisual.gd @@ -185,8 +185,7 @@ func _physics_process(delta: float) -> void: return var next_pos := current_path[path_index] - var flat_next_pos := Vector3(next_pos.x, global_position.y, next_pos.z) - var to_next := flat_next_pos - global_position + var to_next := next_pos - global_position if to_next.length() <= waypoint_reached_distance: path_index += 1 @@ -197,7 +196,10 @@ func _physics_process(delta: float) -> void: velocity.x = direction.x * move_speed velocity.z = direction.z * move_speed - velocity.y = 0.0 + if not is_on_floor(): + velocity.y -= 30.0 * delta + else: + velocity.y = 0.0 move_and_slide() if not global_position.is_equal_approx(prev_pos): diff --git a/world/jajce/JajceWorld.tscn b/world/jajce/JajceWorld.tscn index 3ffaecd..f0f899e 100644 --- a/world/jajce/JajceWorld.tscn +++ b/world/jajce/JajceWorld.tscn @@ -121,6 +121,8 @@ script = ExtResource("3_world") navigation_mesh = SubResource("NavigationMesh_greybox") [node name="GreyboxGround" type="StaticBody3D" parent="NavigationRegion3D"] +collision_layer = 0 +collision_mask = 0 [node name="Mesh" type="MeshInstance3D" parent="NavigationRegion3D/GreyboxGround"] visible = false @@ -136,7 +138,7 @@ data_directory = "res://terrain/jajce/data" material = SubResource("Terrain3DMaterial_jajce") assets = ExtResource("1_assets") collision_mask = 3 -collision_mode = 0 +collision_mode = 1 top_level = true [node name="FortressBlockout" type="Node3D" parent="."]