simple TOUCH of a 3D object in iOS


I tried to find out how to simply detect the touch of a 3D object with iOS. But I could not make it work on device.

Can someone please help me out:

Say there is a cube called "cube" and the user touches it on a iOS device.

How can catch this event??

thank you so much for your help!!!

Putting together Jessy's answer in to a piece of code. The Update() and TapSelect() are put on any ONE Object in the scene. I put it ion my main game controller. The Selected goes on each object you to be able to select.

    // Update is called once per frame
void Update () {

void TapSelect() {
   foreach (Touch touch in Input.touches) {
        if (touch.phase == TouchPhase.Began) {
            Ray ray = Camera.main.ScreenPointToRay(touch.position);
            RaycastHit hit ;
            if (Physics.Raycast (ray, out hit)) {

    public void Selected(){

This is in c#. When the screen is tapped the TapSelect does a Raycast and if anything is hit it sends the Selected() message to the transform.

Cast a ray from the position of a touch.

That code uses ScreenPointToRay, which you should, but it also uses Input.mousePosition, which is not right on iOS. The thing you'll need to replace it with is a Touch.position. There are some examples in the documentation about how to code input for iOS: