#Movement Help
1 messages · Page 1 of 1 (latest)
So, you'll need to, during mobile, disable your normal movement inputs, and simulate them using UI buttons/touch
I've never made a mobile game so i can't help with the touch stuff, but the buttons should be easy enough
i saw tutorials they ssay the script will be different and stuff
i wawnt the ui buttons to act like joystick
yeah input.getaxis.
you know how that works eh - it increases a value from 0 to 1, or from 0 to -1, depending on how long youve been pressing the input
yes
so if you want identical behavior from the buttons, you'll have to simulate that with a lerp
let's see the input.getaxis lines for your movement
and ill show what I mean 🙂
hm but if i do that it's like just pressing button and moving, but i want to act like joystick instead of just pressing.
yes
I've never used touch input before - but what you will want to do, is replace float x and y in that snippet there, with distance checks you get out of your joystick, based on its dragged position relative to the center of the joystick
okay
basically i take drag input kinda like slider
ye. probably best to start by making the joystick and getting it to output between -1 and 1 using a custom distance to center method
okay
then its just a matter of plugging that into your movement script, if it detects mobile
alright, thanks alot for the insight and help bro.
np, gl 🙂