Raycast hit issue with multiple prefab clones.

I my scene I have a sphere prefab with a script that captures mouse click raycasts.
When hit, it instantiates another sphere prefab with the same script, at a different position. It also parents that new object to itself. Works fine.

When I click on that second sphere, I would expect it to capture the click, to load a third sphere prefab and parent it to itself, as per its script.

Instead, I get four objects: the initial prefab, the second sphere parented to the initial one, the expected third one parented correctly to the second, and an extra one parented to the initial prefab. It’s as if both prefabs have captured the click and each has loaded its own sub-prefab.

Am I missing something on how raycasts propagate on parent-child hierarchy?
Or on how they work with clones?

I’m using 4.6 beta 20 - in case that’s not normal behavior.
Can someone shed some light on me?
Thnx.

Every sphere is checking if the camera’s raycast is hitting anything.

I’d do the raycast from an outside source (script attached to camera or player controller) rather than having it execute from every sphere.

If you don’t want to move the raycast, you can check “hit.gameObject” (or “hit.transform.gameObject” if that doesn’t exist) and see if the clicked object is the current object that’s being clicked on.