How can i do the following I have duplicates of the same prefab in the scene. Each of these prefabs has a script with a function called DestroyObject, when called this function removes the object it is connected to.
How can a call the function in the script on the object that is hit by a raycast, and only have the one prefab that is hit by the raycast have its DestroyObject function called and subsequently be destroyed, while the rest of the duplicates of the same prefab are unafected.
asked May 10 '10 at 11:49 AM
assuming you have a RaycastHit variable from a raycast:
answered May 10 '10 at 12:23 PM