center mini-view in front of player
This commit is contained in:
parent
31158b49cb
commit
04f00fd262
|
@ -189,6 +189,17 @@ func update_mini_view():
|
||||||
|
|
||||||
collision_shape.global_position = center
|
collision_shape.global_position = center
|
||||||
collision_shape.shape.size = aabb.size
|
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:
|
else:
|
||||||
levels.position = Vector3(0, 0, 0)
|
levels.position = Vector3(0, 0, 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user