clicked and dragged across it.
Well then. When you put it that way .
You would need to detect when the mouse entered the static body, then exits it again.
All PhysicsBody nodes, including
StaticBody, include two signals.
mouse_exited. You can connect the
StaticBody's signals, these two, to itself. Then you could apply the following logic.
var went_across = 0.0 #when this is one, the mouse has gone across.
func on_mouse_entered(): #the method's name could be different.
went_across = 0.5 #It's in but it hasn't crossed yet.
if went_across == 0.5:
went_across = 1
else: went_across = 0
#Don't no if you want this, but this resets went_across when the left mouse is released.
If not Input.is_mouse_button_pressed(BUTTON_LEFT):
went_across = 0
Just came up with it, so test it.