onActionEnd not triggered with removeEntities #1426
-
| 
         I added inputs via the the override of GameApplication.initInput(). One input is bound to MouseButton.PRIMARY -> onActionBegin/onActionEnd. Any help appreciated. BTW: FXGL is really great and fun to work with, thank you Almas for creating it! EDIT: If these are not set, it works. An unbind before removing the entity does not work, maybe because of synchronization.  | 
  
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
| 
         So this is what works: in the onActionBegin:  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks for this, could be a bug. Please can you provide a minimal standalone example that reproduces this, as a GitHub issue, so it can be tracked and fixed.  | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Thanks for the code example.
I believe the reason why onEnd doesn't fire is because the mouse button
action happens on the entity (since entity always follows cursor due to
binding). I suspect when the entity is removed, the release mouse button
event no longer has the target in the scene graph, so the event never
reaches FXGL.
To test the above theory you can bind to mouseX - 250 for example, making
the entity follow outside the cursor bounds. Then both begin and end seem
to fire normally.
At the moment, I'm not sure where this communication chain gets broken.
I'll have a think about it over the next few days. 
…On Tue, 22 Jul 2025, 10:50 pm maz, ***@***.***> wrote:
 Reopened #1426 <#1426>.
 —
 Reply to this email directly, view it on GitHub
 <#1426>, or unsubscribe
 <https://github.com/notifications/unsubscribe-auth/AA3NT5QLNYBMRZIJQLWLLAT3J2W3BAVCNFSM6AAAAACB7DAJSGVHI2DSMVQWIX3LMV45UABFIRUXGY3VONZWS33OIV3GK3TUHI5E433UNFTGSY3BORUW63R3GIYDKOJZGAYA>
 .
 You are receiving this because you commented.Message ID:
 ***@***.***>
 
 | 
  
Beta Was this translation helpful? Give feedback.
Thank you.
Done:
#1427