can someone give me code for time to stop when you dont move (fps game)

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

id like someone to give me code to do so or explain how to make (prefferably both) time stop when you dont move. (for an fps game)

:bust_in_silhouette: Reply From: zhyrin
  1. Determine what is the criteria for not moving.
  • A simple way to do it is to check the character velocity. If you press an input for movement, you would usually change the velocity (from zero).
  1. Stopping time.
  • SceneTree has a paused member, setting this to true pretty much pauses the entire game, but you can change your scenes to still process while the rest of the game is paused (Node.process_mode)
  • Engine has a time_scale member, setting this to 0 would similarly pause processing

thank you ! i had no idea how to define time stopping and somehow didnt come across velocity.

yoshman | 2023-03-11 18:56