make actor follow finger/touch
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
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
-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
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)