From 04f00fd262172c4c1407e6943bc9e35009be7cc2 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Sun, 28 Jan 2024 15:22:08 +0100 Subject: [PATCH] center mini-view in front of player --- content/system/house/house.gd | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/system/house/house.gd b/content/system/house/house.gd index ab335a6..b6e4df0 100644 --- a/content/system/house/house.gd +++ b/content/system/house/house.gd @@ -189,6 +189,17 @@ func update_mini_view(): collision_shape.global_position = center collision_shape.shape.size = aabb.size + + var camera = get_node("/root/Main/XROrigin3D/XRCamera3D") + var camera_position = camera.global_position + var camera_direction = -camera.global_transform.basis.z + + camera_position.y *= 0.5 + camera_direction.y = 0.0 + + + var target_position = camera_position + camera_direction.normalized() * 0.2 + levels.global_position = target_position - center * 0.1 else: levels.position = Vector3(0, 0, 0)