Godot 4 dev notes

Collection of tips found while making games with the Godot 4 game engine
These may not be the best solutions ever, but these are just the ones that worked for me

Slow motion

A brief slow-down in the action that occurs for example when hitting an opponent.

It can be achieved with this simple function:

func freeze(timeScale, duration) -> void:
    Engine.time_scale = timeScale
    await get_tree().create_timer(duration * timeScale).timeout
    Engine.time_scale = 1

In this example the game speed is halved for one second:

await freeze(0.5, 1)

An additional shake effect could be added to enhance the action.

With this freeze function it is not possible to completely stop the game (Hit Stop), a different approach is needed.

More about this: Masahiro Sakurai about Hit-Stop