is it possible to touch 3d-Object for using Unity in iPhone ?

is it possible to touch 3d-Object for using Unity in iPhone? how about HitTest? i used to this. but i failed. HitTest support only two things.( GUILayer.HitTest , GUIElement.HitTest )

also i tryed to get an Application dataPath in iPhone. i could get datapath in Unity3d. but i faild in iPhone. is it possible ? any idea?

hello, yes, is possible.

Use a raycast and make sure your 3D Object has a collider :)

Checkout this:

private var hit : RaycastHit;
private var ray : Ray;//ray we create when we touch the screen

function FixedUpdate () {

    if(iPhoneInput.touchCount == 1) {
        ray = Camera.main.ScreenPointToRay(iPhoneInput.touches[0].position);
        Debug.DrawLine(ray.origin,ray.direction * 10);
        if(Physics.Raycast(ray.origin, ray.direction * 10,hit)){
            Debug.Log(hit.transform.name);//Object you touched
        }
    }
}

hope it helps.

Great Please elaborate - the item is touched and now I want another item to do something not the object that was touched.

Thanks

Place what you want it to do in place of the: Debug.Log(hit.transform.name);. I Put: gameObject.AddComponent(Rigidbody);. So that when i touch the object it falls

http://forum.unity3d.com/threads/17382-Click-n-drag-iphone

Found this video quite useful:

using layers and raycast to touch and move a 3d Object.

source code is here:

http://www.revelopment.co.uk/tutorials/unitytutorials/73-howtorotateanobjectbytouch

Hi thank you the beautiful script!
How can I open a GUI window with some text into, when I touch one or more object?!
M