Skip to content

Commit

Permalink
Merge pull request #144 from Whyshchuck/101-anti-glide-animation-smoo…
Browse files Browse the repository at this point in the history
…th-scrolling-camera-fix

Refs 101: Main camera position update to smoothly follow anti-glide animated character
  • Loading branch information
stickgrinder authored Jan 3, 2024
2 parents 3216c1b + 1e499e7 commit 71c3cf7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions addons/popochiu/engine/popochiu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,16 @@ func _process(delta: float) -> void:

if _shake_timer <= 0.0:
stop_camera_shake()
elif not Engine.is_editor_hint()\
and is_instance_valid(C.camera_owner)\
and C.camera_owner.is_inside_tree():
main_camera.position = C.camera_owner.position
elif (
not Engine.is_editor_hint()
and is_instance_valid(C.camera_owner)
and C.camera_owner.is_inside_tree()
):
main_camera.position = (
C.camera_owner.position_stored
if C.camera_owner.position_stored
else C.camera_owner.position
)


func _input(event: InputEvent) -> void:
Expand Down

0 comments on commit 71c3cf7

Please sign in to comment.