Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Please help me implement in Libgdx a way to move my character to where I touch

 
john hog
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I move my character from his current location towards where I touch? I have tried the vector2 method for lerping and it just worked out really weird. What is the math / formula/ logic??

I have tried obtaining the angle between both points and multiplying them by my acceleration and speed but nothing seemed to work correctly. I googled and tried a few formulas provided but none of them made my player move to where I want. Like my character can move but not where I click, its almost kind of random. Please help, been at this for a long time and other websites have not been very useful, my game is already published but people have complained of controls so I want to implement the move to where I touch instead of a touch drag movement I used

here is the last thing I tried



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic