I'm trying to make a racing game on android using unity. I want to make a car move forward when I touch an image button like in the picture below. I've already made it work using the keyboard. How do I do the same with on-screen buttons and touch input in android?
If you are using Unity 4.6+ then you have access to its new UI system. If you ever used NGUI, which is a popular unity UI frame work, its based on that architecture I believe. This is a good tutorial on the subject of buttons and how they work. http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-button Quick summary tho:
At step #2 if you want to listen for more specific events just add a new EventTrigger script and pick a more specific event type and set it up by assigning an object and callback. More on that here: http://unity3d.com/learn/tutorials/modules/beginner/ui/ui-events-and-event-triggers |
|||
|