The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates. | Twitter

0 votes

How do I assign or map an InputMap action to an onscreen software button instead of using actual hardware keys from keyboard to perform the intended action (somewhat like what is possible with TouchScreenButton).

Is it possible in Godot ?

Godot version 3.2.3
in Engine by (94 points)

1 Answer

0 votes
Best answer

It is not recommended way in godot for touch input. Instead, feed action back to the engine then you processed your input.


Alternatively, it may be desired to supply the game back with an
action from the game code (a good example of this is detecting

But if you want you can use

by (887 points)
selected by

So there's no way I can do as I want?

You can. See second link. But it's a very simple button.
If you need something more complex, you will have to do it yourself. See first link.

I already tried the TouchScreenButton but it doesn't show up. Why?

Assign action in inspector window of TouchScreenButton.

Sorry for being this late, but I had my exams an have too, so I'd be less active in the forum.

Of course I did that, but it doesn't seem to work. Any idea why?

Doesn't work in what way exactly? Try assigning action from code with TouchScreenButton.set_action()

Sorry if I'm too annoying but I'm new to this - your engine and gamedev in itself.
It doesn't work in the way that the button is not getting the action assigned to itself, don't know why.
This is the code I'm using for it:

func _ready():

Is it alright?

Sorry Sir,
I troubled you a lot, but it was that I had actually commented a code snippet in another script which I didn't just see.
That was all causing the problem.
Sorry once again and Thanks a lot for your help :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.