fix: camera inverting when falling

This commit is contained in:
Sara 2025-05-28 19:33:22 +02:00
parent 1f76dbbc8a
commit 063d3d7e15

View file

@ -18,7 +18,10 @@ func _ready():
func _process(_delta):
var target : Vector3 = get_parent().global_position + Vector3(0.0, pivot_height, 0.0)
var diff := self.global_position - target
if abs(diff).x + abs(diff.z) > 0.1:
self.look_at_from_position(target + diff.normalized() * dist, get_parent().global_position + Vector3(0.0, look_target_height, 0.0))
else:
self.global_position = target + diff.normalized() * dist
"
[node name="Player" type="PlayerBody"]