Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to be able to drag a sprite that is currently on a path from a path modifier. Currently, I have sprites on a path, and I have stationary sprites that are draggable. However, simply overriding the sprite's onAreaTouched doesn't work until the sprite completes its path. How would I do this?

share|improve this question
up vote 2 down vote accepted

I see those possibilities:

  • you could call clearEntityModifiers(); in the onAreaTouched of your sprite. This will kill all modifiers you registered to the sprite (so your pathmodifier but also any AlphaModifier or else).
  • or you can call unregisterEntityModifier( yourPathModifier );

hope this helps. regards


share|improve this answer
I put a Log.i inside the onAreaTouched event and nothing registers until after the path is clear. So trying to call those methods will not work. My only thought right now is to add a transparent sprite over-top of the path modified sprite (which updates with the game loop) to utilize its onAreadTouch but this seems very clunky.... – Brandon Jan 31 '13 at 18:22
that's odd... maybe there is something else blocking the onAreaTouched. It is definitely possible to touch a sprite when it is moving and to kill the modifier at any time – I did it before, although I didn't make the sprite draggable like you do. But that shouldn't be the point. Maybe you can add code to the post, like for example your onAreaTouched and the part where you create the PathModifier. – GameDroids Jan 31 '13 at 22:20
It was my mistake, I added the Log.i to the wrong onAreaTouched. This did work, thanks! – Brandon Feb 1 '13 at 18:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.