make actor follow finger/touch

Games!Games! Member, PRO Posts: 11

I want my actor to follow the players touch (likely extended touch) on the iphone screen. How can i do this?

I have done it so it follows the mouse- but also when it arrives at the mouse it stops working.

If you can help with either, please do.

Comments

  • ThoPelThoPel GermanyMember, PRO Posts: 184

  • jay2dxjay2dx Member Posts: 611

    Include the rule when touch is true!

    You'll find it in device Mouchel touch,

    If you want the continue to the touched position after the user has lifted their finger you need to constrain the touch position to some game attributes and use that too

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    -Constrain attribute self.position X to game.mouse position X.
    -Constrain attribute self.position Y to game.mouse position Y.

    Mental Donkey Games
    Website - Facebook - Twitter

  • SEMASEMA Member Posts: 161
    edited July 2015

    constrian-self.motion.linearVelocity.x ,to, 5x(game.Touches.touch1.x-self.position.x)
    do the same for y
    constrian-self.motion.linearVelocity.y ,to, 5x(game.Touches.touch1.y-self.position.y)

Sign In or Register to comment.