0 votes

I'm creating a custom node for touch gesture input detection. Would it be better to create a node with signals for the different events or use Input actions and pass the event through the SceneTree?

in Engine by (106 points)

have you made some progress? I would need swype gesture for a project and i'm starting to implement it, however if you have code already done it it would be really fantastic!
Let me know

1 Answer

0 votes

If you will re-use/instance that node a lot, I'd use the input action approach.
So you don't have to worry about connecting to the appropriate signals on every new instance.
On the other hand, the signal approach is more lightweight (performance-wise) I guess.

So.. it's hard to suggest a "proper" way, both are ok.
It depends on how your project is structured, just pick the one that suits you the most.

by (924 points)
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 webmaster@godotengine.org with your username.