How do you achieve smooth actor to follow touch?

orien2v2orien2v2 Member, PRO Posts: 55
edited November -1 in Working with GS (Mac)
Title says it. How do you guys get a smooth motion of an actor which goes wherever your finger goes? I mean follow your finger, not just move to it. Something like a mouse cursor. I tried:

constrain self.position to game.touches 1X and Y... doesn't work on device. The actor can't catch up to my lightning fast fingers which honestly isn't really fast as I'm not very athletic.

interpolate it's position, even worse. don't get me started on move. It literally almost killed my hope of achieving this. Ideas anyone?

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    when actor recieves event touch is pressed

    constrain self position x to mouse position x
    constrain self postion y to mouse position y

    cheers
  • orien2v2orien2v2 Member, PRO Posts: 55
    JohnPapiomitis said:
    when actor recieves event touch is pressed

    constrain self position x to mouse position x
    constrain self postion y to mouse position y

    cheers

    Nope. Doesn't work. I know this has been raised billions of times but honestly all those suggestions don't really provide accurate feedback. My actor always tries to catch up to my finger instead of being there following it.

    I know it works on Mac like it's responding perfectly if you try using Web Preview you know what I mean, but once you preview it on your device it sucks badly. Any more suggestions anyone? So far, constraints, interpolate, move, accelerate all doesn't seem to work.
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    works perfect for me on the device. whats the fps and memory like, could be your the game slowing it down
  • StorerDevStorerDev Member Posts: 10
    i did as he mentioned above and all that happened was my actor moved very very slowly towards the mouse whats up with that?
  • orien2v2orien2v2 Member, PRO Posts: 55
    JohnPapiomitis said:
    works perfect for me on the device. whats the fps and memory like, could be your the game slowing it down

    I can't test with the GSviewer for some reason it wouldn't detect. The only way I can get it to my device is through publishing it. And my game doesn't have anything just a blank scene with a white 10px X 10px box so I think it's not a game issue. Did you try moving it fast like a slashing motion back and forth? The box always lags behind which is kind of frustrating...
    StorerDev said:
    i did as he mentioned above and all that happened was my actor moved very very slowly towards the mouse whats up with that?

    don't know, but mine is moving at the right speed but slow frame rate.

    Can someone help me test it out? I think you don't need me to publish it right. Just an actor following the finger. And make sure you try moving fast as in a slashing motion back and forth.
Sign In or Register to comment.