How to stop input player?

Godot Version

Godot Engine v4.3.stable.

Question

Have any ways to create this? Please, explain for a beginner.

If you require help, I recommend first trying to read up on the issue you’re facing by doing a few google searches. Try to see if you can find any guides or examples online. If that doesn’t help, try to give a more accurate and specific description of the issue you’re facing, and try to put some more effort into your post when asking for help, otherwise people might not even know what you need help with exactly.

1 Like

It depends on what you are trying to achieve. Theorically, you could use set_process_input(false), or set_physics_process(false) and that’s it.

But more likely than not, you might want to have your own custom logic, and for that you need to implement States for the player, if the player is in the state “STOP” then block any function that makes the character move.

Pseudocode

var is_stopped: bool = false

in input() or Physics_process(): 

if not character.is_stopped: 
    If Input.is_action_pressed("ui_up):
         # your movement action that won't longer work
2 Likes

thanks, my account was blocked several times and i tried to write something.

thanks, that definitely works