Best method of implementing control buttons?

What’s the best method to add buttons on an ios/android mobile so my character can move? I’ve tried GUI buttons but there isn’t multi touch and if I touch the screen and move the finger while touching on a button, it doesn’t get activated. What are my options?

Try the included mobile assets and modify from there for your own needs or use them as inspiration. Unity comes with 4 or 5 mobile controllers. You have to import them, in your project manually.

Touch is a class you can use to monitor touch.

Mouse commands also work.

Both of these, in general need to use a ray, as a raycast, hit collider will designate if you are tapping left btn or right btn or pause btn etc.

There are plenty of assets which help in this as well. EZGUI, NGUI… the list goes on.

The vast majority (of people I have talked to and work with anyway) strongly dislike games with buttons onscreen when they play mobile titles. I tend to agree, since there is no tactile feedback when using controls that way on a touch screen. To me I think it’s like trying to force a handheld device into being something it’s not (a super NES). Besides, those buttons take up real estate on your screen, making a smaller area playable.

So I urge you to think of a way to design the controls so that for most of the actions, you don’t need actual visible buttons. Games like this seem more like they were designed with a touch screen from the very beginning, which is usually true. Finger Gestures plugin is good and makes touch screen controls work the same as mouse equivalents so you don’t have to write both. I recommend it.

One way is to shoot a ray as suggested from the mouse / touch point to hit the ground plane you create, and if you need a larger area, have an invisible large object with a collider that moves to where you touch, and check for collisions or triggers. I used this for my last game and it worked very well.

If you absolutely must have buttons, NGUI is wayyyyyyy easier to use than EZGUi. And cheaper too I believe.

But as far as I know, NGUI only makes buttons. I mean, I think that if you add some buttons and press and hold one of them and slide to another button, it doesn’t get hit. You have to untouch the screen and then touch the button again. Or is there any way to achieve that in NGUI?