Can anybody help me with a smooth touch control?
Hi and thank you for any help you can provide.
I have a player object who floats through the air and dodges obstacles. Currently, I am using the Horizontal and Vertical Input.GetAxis functions with an AddForce method. The movement is really smooth and when I press one of the arrow keys, my player smoothly flies in that direction based on the force and position etc. It looks as if the object is really floating or gliding through the air.
I am wandering what would be the best way to code that for mobile touch devices. I have searched the internet with a fine tooth comb to find exactly what I am looking for but no luck. I did find a Joystick script that allowed me to swipe in a direction and the player would move in that direction but it used the Translate method so there was really no float-like force, not to mention it wasn't what I was looking for, but it kind of opened me up to Mobile Touch.....a little bit. I need to be able to, say, touch somewhere on the screen and the object smoothly glides to my finger, touch somewhere else and it changes directions (slowly, based on the addforce), and even if I don't take my finger off but drag it around, move towards my finger.
Can somebody please help me out with this? Fairly new to Unity. Thank you so much in advance!!