• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
reply
    Bookmark Topic Watch Topic
  • New Topic