Forum begins after the advertisement:


[Part 5] Bug where dashing into an enemy causes time to freeze indefinitely

Home Forums Video Game Tutorial Series Creating a Metroidvania in Unity [Part 5] Bug where dashing into an enemy causes time to freeze indefinitely

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #11513
    Kiefer Neo
    Level 12
    Moderator
    Helpful?
    Up
    0
    ::

    Some of our commenters in the Youtube series have pointed out that dashing into an enemy causes the game to freeze. This is happening due to the hit stop mechanic where time slows down when the player gets hit which acts as feedback for the player telling them that they’ve been hit.

    Due to the player being in the dashing state when the player gets hit, the RestoreTimeScale() method, which moves the Time.timeScale value back to 1. does not get called in the Update() function.

    To fix this all we have to do is move where we call the RestoreTimeScale() method up and above the if(pState.dashing) return; line so that RestoreTimeScale() will be called before the return statement.

    #11591
    Kiefer Neo
    Level 12
    Moderator
    Helpful?
    Up
    0
    ::

    The player is frozen after dashing into an enemy.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.

Go to Login Page →


Advertisement below: