[SOLVED] How to get joystick input using VISUAL SCRIPT

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nico_fr
:warning: Old Version Published before Godot 3 was released.

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

:bust_in_silhouette: Reply From: Zylann

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

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.

:bust_in_silhouette: Reply From: Nico_fr

Great, thanks Zylann
it works perfectly.

would you know also for mouse position ?
Thank you