actor move to mouse problem

johnboymacjohnboymac Member Posts: 33
edited November -1 in Working with GS (Mac)
Im trying to make my actor move towards the mouse. this works when you first click, and works for a couple of second of subsequent clicks. it then freezes, in mid move and no further mouse events are acted on. however other events such as keyboard events do allow the actor to move, so the game is not completely frozen. does anyone have advice on making an actor follow the mouse? - p.s. not constrained to mouse, the intention is to click on a part of the screen and have the actor move to that location.

cheers, J

Comments

  • johnboymacjohnboymac Member Posts: 33
    Just thought I would add an update. I had a moveto x,y in the actor, that would move the actor to the x,y coords of the mouse. this was constantly checking and updating the moveto (i.e. without a pause) - this seems to have eventually made this particular rule tie itself in knots. by adding a timer to the moveto, such that it only checks every .2 seconds, the issue no longer appears. i need to also set it such that the rule only kicks in at all if the mouse xy and the actor xy are not the same.

    J
Sign In or Register to comment.