#Movement Help

1 messages · Page 1 of 1 (latest)

jagged dove
#

help here

latent vapor
#

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

jagged dove
#

i saw tutorials they ssay the script will be different and stuff

latent vapor
#

what are you using to get input on your character controller?

#

getaxis?

jagged dove
jagged dove
latent vapor
#

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

jagged dove
#

yes

latent vapor
#

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 🙂

jagged dove
#

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.

latent vapor
#

Ohhhhh right I see what you mean

#

an on-screen mobile joystick

jagged dove
jagged dove
latent vapor
#

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

jagged dove
#

basically i take drag input kinda like slider

latent vapor
#

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

jagged dove
#

okay

latent vapor
#

then its just a matter of plugging that into your movement script, if it detects mobile

jagged dove
#

alright, thanks alot for the insight and help bro.

latent vapor
#

np, gl 🙂