fix: camera tracks player elevation; snap all world objects to terrain
Camera: desired_focus_position.y now directly tracks the player's global Y. The existing smooth lerp on focus_position handles interpolation, so the camera follows the player up hills and down slopes without losing vertical sight. Previously only horizontally-deadzoned XZ was tracked. jajce_world.gd: expanded terrain-snapping coverage to include all nodes under WorldObjects (ResourceNodes, StorageSites, ActivitySites) and the FortressBlockout's children. Added a type guard so non-Node3D children are safely skipped. This prevents houses, activity props, storage crates, and resource nodes from floating above or sinking below the sculpted terrain surface.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user