So, my player moves over my ladder, and the map changes. However, it changes before he is completely over the ladder, so in the next map he finishes his move onto the ladder he just climbed down.

My movement is grid based smoothed out by tweens. So, I am pretty sure what happens is the map changes however the tween hasn't completed, so it keeps going while the map changes, and finishes up on the new map.

My question, other than creating a transition screen to hide this movement, is there any suggestions how I can make it so the player stops moving, or the map changes doesn't happen until after the movement is done?

  • Jesusemora replied to this.
  • Jesusemora Well the problem is that it continues til it ends. The map changes in the middle of the movement so the player is still moving on the new map.

    I think I found a solution, haven't implemented yet.
    I will make a var wait_for_player = bool

    In physics_process if it is true I will deactivate player input, and check if player_pos == ladder_pos.
    If true I will initiate scene change and reactivate input and set wait_for_player to false

    Edit: So it works, I added the boolean var and check it in physics frame, then I turn players input off so they can't move again. I then keep checking to see if the player has arrived at the ladders position. Once that is true, the boolean is set to false, the map_change() is called and player input is turned back on. This fixes the problem.

    xRegnarokx My question, other than creating a transition screen to hide this movement, is there any suggestions how I can make it so the player stops moving, or the map changes doesn't happen until after the movement is done?

    that is up to how the game is coded.

    if you are using tweens, the movement should continue until it ends, so I don't see what the problem is.
    if you want the character to not move, you should check some boolean and lock the player from controlling the character during the transition.

    we really can't help you with so little information.

      Jesusemora Well the problem is that it continues til it ends. The map changes in the middle of the movement so the player is still moving on the new map.

      I think I found a solution, haven't implemented yet.
      I will make a var wait_for_player = bool

      In physics_process if it is true I will deactivate player input, and check if player_pos == ladder_pos.
      If true I will initiate scene change and reactivate input and set wait_for_player to false

      Edit: So it works, I added the boolean var and check it in physics frame, then I turn players input off so they can't move again. I then keep checking to see if the player has arrived at the ladders position. Once that is true, the boolean is set to false, the map_change() is called and player input is turned back on. This fixes the problem.