hi guys ,
i was following unity 2d series and while adding character control i wanted to know how to do it for mobile games , like what unity api should i use to capture touch inputs and how to build and test games on mobile simultaneously ,
Hi Johnathan
I am sorry this question got overlooked.
We cover this in our mobile games course and it involves adding another package built into unity the name of which escapes me at the moment.
We do a sort of asteroid game in that course which i think with locking the rotation and the position you can get the effect you are looking for.
Hope this helps or you already found a solution
hi thanks for the reply ,
i came up with something called onScreen buttons ,but that does not seem to work when build for android devices i am not sure why,
this is what i have done
create a canvas → add text mesh pro buttons → add onscreen button component ->lisen to keyboard stroke for left, right and jump buttons respectively,
i build and run for android game starts but when buttons are pressed player is not moving as expected
a little hint towards suitable resources would be helpful i guess
A regular Button from UnityEngine.UI should do the trick.
With Android (or iOS), we generally don’t have a keyboard, so any methods listening for keystrokes simply won’t work.
What you want to do is create public methods that both your keyboard listener (for Windows games) and the button (for both) call to do the actual movement. Then hook your button’s OnClick event up to call the corresponding method.
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.