0 votes

Hi
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 (17,979 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:
http://docs.godotengine.org/en/latest/classes/index.html

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 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.

Categories