Hi guys, I am trying to move player at screen touch event direction, and actually i got it some far, here are few lines.
local function movebox(event)
Player:setLinearVelocity( event.x - Player.x, event.y - Player.y )
print(“move box”)
end
Runtime:addEventListener(“tap”, movebox)
With this i am able to move player in touched direction, the only problem is speed.
For eg. if i tap on the screen 100 pixels away from players position players will move at the speed of say 100. and if i touched screen 200 pixels away from player then player will move at the speed of 200. Like it seems like player start moving faster at longer distance.
What i want to do is i want to keep the speed amount constant.
Thanks in advance [import]uid: 83799 topic_id: 26388 reply_id: 326388[/import]

[import]uid: 52491 topic_id: 26388 reply_id: 110257[/import]