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.button
s 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
Post a Comment