When the PC (in the future any other character) stops moving, it would be good to have a virtual function so devs can define a custom behavior for that. E.g. Stop a looping walking audio file.
Solution description
Add a _on_move_ended virtual function to PopochiuCharacter. This function will be called by the room when the movement stops either by an interaction of the player (e.g. clicking anywhere in the room) or because the moving character reached its target movement position.
Implications
Scripts that are connected to, or awaiting for, the move_ended signal of the moving character, could trigger unexpected behaviors since they may assume that the signal will only be triggered when the character reaches its target, but not when the target has changed due to player interaction.
Benefit description
When the PC (in the future any other character) stops moving, it would be good to have a virtual function so devs can define a custom behavior for that. E.g. Stop a looping walking audio file.
Solution description
Add a
_on_move_ended
virtual function to PopochiuCharacter. This function will be called by the room when the movement stops either by an interaction of the player (e.g. clicking anywhere in the room) or because the moving character reached its target movement position.Implications
Scripts that are connected to, or
await
ing for, themove_ended
signal of the moving character, could trigger unexpected behaviors since they may assume that the signal will only be triggered when the character reaches its target, but not when the target has changed due to player interaction.