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

Capture and play voice with Asterisk ARI -

c++ - Can not find the "fiostream.h" file -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -