Skip to content

Commit

Permalink
Merge pull request #2684 from gamerbross/bugfix/camfollow-pause-game
Browse files Browse the repository at this point in the history
[BUGFIX] Pause Camera Follow when pausing
  • Loading branch information
EliteMasterEric authored Jun 8, 2024
2 parents d39f3dc + cd48521 commit aace5e2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions source/funkin/play/PlayState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -1211,6 +1211,9 @@ class PlayState extends MusicBeatSubState
cameraTweensPausedBySubState.add(cameraZoomTween);
}

// Pause camera follow
FlxG.camera.followLerp = 0;

for (tween in scrollSpeedTweens)
{
if (tween != null && tween.active)
Expand Down Expand Up @@ -1255,6 +1258,9 @@ class PlayState extends MusicBeatSubState
}
cameraTweensPausedBySubState.clear();

// Resume camera follow
FlxG.camera.followLerp = Constants.DEFAULT_CAMERA_FOLLOW_RATE;

if (currentConversation != null)
{
currentConversation.resumeMusic();
Expand Down Expand Up @@ -3070,7 +3076,7 @@ class PlayState extends MusicBeatSubState
FlxG.camera.targetOffset.x += 20;

// Replace zoom animation with a fade out for now.
camGame.fade(FlxColor.BLACK, 0.6);
FlxG.camera.fade(FlxColor.BLACK, 0.6);

FlxTween.tween(camHUD, {alpha: 0}, 0.6,
{
Expand Down Expand Up @@ -3165,7 +3171,7 @@ class PlayState extends MusicBeatSubState
cancelAllCameraTweens();
}

FlxG.camera.follow(cameraFollowPoint, LOCKON, 0.04);
FlxG.camera.follow(cameraFollowPoint, LOCKON, Constants.DEFAULT_CAMERA_FOLLOW_RATE);
FlxG.camera.targetOffset.set();

if (resetZoom)
Expand Down

0 comments on commit aace5e2

Please sign in to comment.