javascript - Move a character with touch buttons in unity -


i creating mobile game in unity android devices , scene sprites, 2d game. know input.getaxis() can move character desktop apps. need know how axis horizontal movement , info , assign mobile button

you need use unity ui system eventsystem. create canvas , unityui.buttons want (an eventsystem , object should created), add eventtrigger component button want control movement , hook onpointerdown (and onpointerup if want) event function script. (list of events: http://docs.unity3d.com/manual/supportedevents.html). in function can put logic of controlling player / movement.

this demonstrated in 1 of unity's learning videos @ https://unity3d.com/learn/tutorials/modules/beginner/ui/ui-events-and-event-triggers.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -