system
1
|
|
|
|
Attention |
Topic was automatically imported from the old Question2Answer platform. |
|
Asked By |
BrunoFreezee |
I need to make a variable that is true if ANY key is pressed or just pressed and if you let no key pressed the variable is false
exemple:
if (input == any key): - Just an idea
any_key = true
else: (if input == null)
any_key = false
thanks, I hope you understand
system
2
|
|
|
|
Reply From: |
Andy |
For Godot 3.2:
In menu Project -> Project Settings -> Input Map
add custom Action. For example, jump
.
Add key to this Action.
Now you need to check for this action somewhere.
Let’s say you have Player
scene, root Node is a KinematicBody2D and GDScript attached to it.
In script add function:
func _physics_process(delta):
if Input.is_action_pressed("jump"):
# add desired outcome here
system
3