Micro-Stuttering, but on purpose.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Technipion

Hi Community,

I have a game with fighting scenes in it. When the player hits an enemy with his sword (or is getting hit), I want to basically pause the game for just a 10th of a second or so, to give the impression of “whoah something just happened”.

How would you guys do that? Using pause? Or do you have any suggestions?

Thx in advance!

You could use the engine’s pause feature, but honestly it seems like a quick fix that might cause some issues down the line. It may be better to implement some form of custom pause.

I needed to pause my player’s activity during certain times, without resorting to the engine pause. What I did was create a disable() which disabled their collision, and stopped move_and_collide() from firing and reset the player’s inputs on frames that the player_active state was false. If there were any functions that fired in response to signals, I also had them check the player’s state before running.

That’s only for one node though, it’d probably be more complicated to stop everything, but hopefully that description helps.

denxi | 2020-02-22 22:51