Click on prefab (16696)

Hii, i'm new to unity 3d, i have some my prefabs. now i want make them click able. i'm familiar with flash. but in unity i am not understanding how can i apply a button to any prefab with some action.

So plz anybody who knows how to make prefab clickable ,tel me... ( eg: when i 'll click on one prefab it will perform some action like should display some msg or image.

)

Thanks,

Pravin Gate

1 Answer

1

You want to add a script that looks like this to the object.

function OnMouseDown () {
// your code here.
}

according to this , i had written in this way , function OnMouseDown () { Application.LoadLevel ("good_work_01"); } and attached this script to the particular prefab on which click , i need to load another scene. Bt it "didnt" worked .. why is it so?

Did it come up with an error message? Does your prefab have a collider?