Input method not found in gd script

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

I started a new project yesterday. And when I started coding. I started using something like

if Input.is_action_just_released("left_click") :
some random code

Input’s method such as is_action_just_released and is_action_pressed do not show up on the pop up menu when typing Input in gdscript. At first I didn’t think about it much. But then when I manually enter the rest of the code. And run them. Nothing happened. And I didn’t get any error messages. But if I use

func _unhandled_input(event):
if event.is_action_just_pressed("left_click"):
some code here

Then methods mentioned would show up in the pop up menu. I am not sure what I did or if this is a bug or something? Any help would be appreciated
I am using godot 3.3 stable

I tested with 3.3 stable and wasn’t able to repeat the issue you have had.
Like user Help me please suggests, if nothing happens with is_action_ then it’s more likely an Input Map issue.
Try again with the in-built Input Map, for example (with Enter or Spacebar):

func _process(_delta):
    if Input.is_action_just_pressed("ui_accept"):
        print("Input works in Process")

func _unhandled_input(event):
    if event.is_action_pressed("ui_accept"):
        print("Input works in InputEvent functions")

Yuminous | 2021-07-15 03:22

:bust_in_silhouette: Reply From: Help me please

Have you added the input (“left_click”) in the input map.
If not, then go to project…project settings…Input Map. Now add an action named “left_click” and add the event when you want this action to occur.

Your code has no mistake so an issue might be here or somewhere else

yes, I did. I am probably not clear on what I am asking. What I meant is the actual method
is_action_just_pressed or its reverent methods such as is_action_just_released is not found on the pop up menu.

lowpolygon | 2021-07-15 04:07

Try using some print() to check where is the mistake

Help me please | 2021-07-15 04:43