0 votes

I have drone in my game represented by area2D with animated sprite and with collision shape 2d, i connected mouse entered and mouse exited to collision shape, it works correctly (i see print whenever i hover over it), but when i start my game,
i have one drone on coordinates (32, 32), and when i hover mouse over it, i dont see my print from "onArea2Dmouseentered()" (i have turned on collision shape 2d visibility), only around the edges like 1 or 2 pixel wide it detects mouse, it works correctly on my other areas 2d that have the same script etc. When i unpause the game and let the drone move (even by 1 pixel) it suddenly starts working correctly.
Anyone knows what could be the cuase of this behaviour ?

Godot version 3.3.3
in Engine by (12 points)

do you have any controls node in the scene? (eg; buttons, labels, panel)
if the drone on 32 32 is behind one of those (maybe transparent) it will not get any input event from mouse

Yes! this was the problem, thank you, i had TextureRect in the scene, which took quite a bit of area, but i didnt think it would interfere with this, since it was empty and wasnt called anywhere in the code.

Please log in or register to answer this question.

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.