diff --git a/player/camera_rig.gd b/player/camera_rig.gd index 25cc79f..5d97fe6 100644 --- a/player/camera_rig.gd +++ b/player/camera_rig.gd @@ -78,6 +78,8 @@ func _physics_process(delta: float) -> void: cam_forward * (diff_forward - sign(diff_forward) * deadzone_forward) ) + desired_focus_position.y = target_pos.y + focus_position = focus_position.lerp(desired_focus_position, focus_t) zoom_smooth = lerpf(zoom_smooth, zoom, follow_t) diff --git a/world/jajce/jajce_world.gd b/world/jajce/jajce_world.gd index 228348b..c572f2c 100644 --- a/world/jajce/jajce_world.gd +++ b/world/jajce/jajce_world.gd @@ -11,14 +11,25 @@ func _initialize_world_presentation() -> void: var active_camera := get_viewport().get_camera_3d() if active_camera != null: terrain.set_camera(active_camera) + var groups_to_snap: Array[Node] = [] groups_to_snap.append_array($FoliageRoot.get_children()) if has_node("FortressBlockout"): groups_to_snap.append($FortressBlockout) + groups_to_snap.append_array($FortressBlockout.get_children()) for child in $VillageRoot.get_children(): groups_to_snap.append(child) + if has_node("WorldObjects"): + var wo := $WorldObjects + for group_name in ["ResourceNodes", "StorageSites", "ActivitySites"]: + if wo.has_node(group_name): + groups_to_snap.append_array(wo.get_node(group_name).get_children()) + for item in groups_to_snap: - var pos: Vector3 = item.global_position + if not item is Node3D: + continue + var node3d := item as Node3D + var pos := node3d.global_position var h: float = terrain.data.get_height(pos) if not is_nan(h): - item.global_position.y = h + node3d.global_position.y = h