fix: camera inverting when falling
This commit is contained in:
parent
1f76dbbc8a
commit
063d3d7e15
|
@ -18,7 +18,10 @@ func _ready():
|
||||||
func _process(_delta):
|
func _process(_delta):
|
||||||
var target : Vector3 = get_parent().global_position + Vector3(0.0, pivot_height, 0.0)
|
var target : Vector3 = get_parent().global_position + Vector3(0.0, pivot_height, 0.0)
|
||||||
var diff := self.global_position - target
|
var diff := self.global_position - target
|
||||||
self.look_at_from_position(target + diff.normalized() * dist, get_parent().global_position + Vector3(0.0, look_target_height, 0.0))
|
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"]
|
[node name="Player" type="PlayerBody"]
|
||||||
|
|
Loading…
Reference in a new issue