0 votes

How to limit the scope of getviewport (). Getmouse_position (). For example, mouse tracking was only in one block?

in Engine by (12 points)

1 Answer

0 votes

I'm a little confused by your question, but if you only want to get the position within a certain square, you could just setup some conditionals that ignore the position unless it is within the bounds of a square. For example:

if getviewport (). Getmouseposition ().x > 100 and getviewport (). Getmouseposition ().x < 200:
# Do something now that you know the x position is within the scope you care about

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