Skip to content

Pressing the button #38

Answered by gilzoide
Mikhail666999 asked this question in Q&A
Jan 7, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Like described in From GDScript to Lua, Godot's singleton objects like Input are all readily available to Lua. The only change is that you need to use Lua's method notation with a : instead of .:

if Input:is_action_pressed("ui_accept") then
    -- do something
end

If in doubt, you can always use the Lua REPL bundled in the plugin to test out these syntax things.
It's located at the bottom tab of the editor.

Screen.Recording.2023-01-07.at.19.28.32.mov

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Mikhail666999
Comment options

@gilzoide
Comment options

Answer selected by Mikhail666999
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants