[SOLVED] How to get mouse input using VISUAL SCRIPT

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Nico_fr

I’m wondering how I could acces the input of the mouse in visual script, for instance in order to move the caracter as I move the mouse… any idea ?

Thank you

:bust_in_silhouette: Reply From: kidscancode

Are you trying to get the mouse coordinates?

get_global_mouse_position() and get_local_mouse_position() are both methods of CanvasItem, so if you’re using a 2D node, you can use “CallSelf” and call one of those functions.

Otherwise, your best bet is to add mouse click action(s) to the Input Map, and use the Input.is_action_pressed() function. You can get this from EngineSingleton → CallInstance.

:bust_in_silhouette: Reply From: Nico_fr

Thank you for your great answer “Kidscan code” and thank you also for your tutorial videos :slight_smile:
may be you also know the answer of this larger question : is there a full list of all visual-scripting nodes available, and their equivalent GDscript instruction ?.
and thanks again.

There’s a full list of nodes in the API docs:
All classes — Godot Engine (latest) documentation in English

They’re not really separated out. Honestly, VS is still very new so there hasn’t been much time for the community to contribute much in the way of documentation. I started to do some work with it, but honestly, I find it far more frustrating and cumbersome to use than GDScript, so I’m not really recommending it to my students.

kidscancode | 2018-03-13 16:02