0 votes

I have a script that sets a nodes global position = to mouse position and it works fine.
But if I hover it over an area 2d it doesn't detect it. What can be the problem

Godot version latest
in Engine by (70 points)

1 Answer

0 votes

If it were a gui Control, I would say most likely culprit is mousefilter property...
There might be another control above it that's stealing the mouse move event... you could check the z-index of the area2D.
Also, the collision shape node might be disabled.
Not sure if relevant, but the input/pickable property might be a factor
Also, what event/signal are you using for this? you should probably be using the Area2D's mouse
entered event for this, or the _input() event if you want more control

Seeing some code would be really helpful. I would debug to see if maybe the event gets called, but the code is not executing the way you imagine.
Also, there's a debug-draw collision shapes setting somewhere that could help... maybe the area is not where you think it is.

by (1,342 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.