Quick help with mouse following

wookie264wookie264 Member Posts: 5
edited November -1 in Working with GS (Mac)
Quick thing I need help with:

In my game, I want a little target (pointer, aimer, etc.) to follow my mouse. I also want it to have lag time, as in I want it to follow the pointer at only a certain speed, tell it where to go and it goes there slowly. Basically right now, I have a rule that says: If mouse location x isn't equal to target location x and mouse location y isn't equal to target location y, move to mouse position x and y at 105 speed. I have tried this without a rule but it still does something odd. If the target ever catches up with the mouse, it freezes and stays put, no matter what. This is really annoying, how can I fix it?
Thank you for helping, I'm fairly new.

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    If you mean what i think you mean then constrain to the mouse position not move to.the move to tells the crosshairs once it reaches the mouse position stop moving, thats why it freezes when the meet.
  • wookie264wookie264 Member Posts: 5
    Could you elaborate? I'm new.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Your telling the crosshairs to move to the mouse position correct? So the crosshairs are being told to move to where the mouse position is. So when you move the mouse the crosshairs are following the mouse but your only telling it to move to the mouse position so when it actuually reaches where its being told to move(reaches mouse position) it stops moving, because its reached where you told it to move. Following? So you need to constrain the attributes in the crosshairs self.position.x and self.position y to those same attributes but for the mouse (or touch 1) So that its constantly being updated to the mouse position and does so even if its reached the mouse position. So going into the crosshairs actor drag 2 constrain attribute behaviors. In the first one click the ... click on self(the name of the actor) then go to position then x. Then go to the expression editor which is next to where you just typed that and click on device touch one. Then do the same for the y. Hope you understood and i didnt mes anything up cause im running a mile a minute working on my current project.( Please correct if i made a mistake)
  • wookie264wookie264 Member Posts: 5
    Thank you
Sign In or Register to comment.