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

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

in Engine by (50 points)
edited by

2 Answers

+1 vote
Best answer

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.

by (22,191 points)
selected by
0 votes

Thank you for your great answer "Kidscan code" and thank you also for your tutorial videos :)
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.

by (50 points)

There's a full list of nodes in the API docs:

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.

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.