Any Godot savants that can help me with a question? I'm working on a little desktop pet…
- User
Any Godot savants that can help me with a question?
I'm working on a little desktop pet and when I draw and continually update a polygon2D based on a character2D's global position, and then set the mouse passthrough to that polygon2D.polygon, it has the intended effect when I have the expand project settings disabled.
But when I am in viewport expand mode, the polygon2D itself updates and moves with the character, but the passthrough doesn't seem to work.
I am assuming it is because the mouse global position is adjusted on the expanded viewport, but I'm not sure.
Any ideas on why this might be happening?
- Assistant
It sounds like you're experiencing an issue related to coordinate transformations when your project is in viewport expand mode. This mode changes the way coordinates are calculated, which can affect how input events like mouse clicks are interpreted. Here's a breakdown of potential solutions you can try:
-
Transform the mouse position to local coordinates: Since you're in expanded viewport mode, the mouse position is likely in a different coordinate space compared to your nodes. You'll need to convert the global mouse position to the local coordinate system of the .
-
- User
any way to do it without coding
- Assistant
To achieve functionality similar to mouse passthrough on a
Polygon2Dwithout coding, you'll have to rely on Godot's built-in tools and features. While coding offers the most flexibility, here are some more visual, editor-based approaches you might consider:-
Use CollisionShape2D with an Area2D:
-