0 votes

Hi,
I'm using visual script, and thus I'm wondering how I could acces the joystick input, for instance in order to move the caracter as I move the joystick...

keybord acces is well documented, but I couldn't imagine for joystic (nor mouse)

any clue ? Thanks

in Engine by (50 points)
retagged by

2 Answers

+2 votes
Best answer

You can do so by creating a Call node, calling the get_axis function on the Input singleton:

enter image description here

There is a wide choice of axes to choose from in GlobalConstants. For example, JOY_AXIS_0 seems to map to the horizontal value of the left stick.

by (28,733 points)
selected by
[SOLVED] How to get mouse input using VISUAL SCRIPT
0 votes

Great, thanks Zylann
it works perfectly.

would you know also for mouse position ?
Thank you

by (50 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 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.