Raycast to get child worldposition is making me cry

I’ve got a parent cube (prefab) in ‘default’ layer.
I’ve got a sphere (prefab) in ‘layer1’ layer.

I have multiple sphere prefabs being the child of the cube prefab.

I’ve gotten so far using layer mask that when I click on the parent nothing happens, when I click on a child the console tells me it’s a hit.

As I have multiple sphere childs on the parent I’d like the world position of the particular child the ray hit. But whatever I try its always returning the parent cube world position.

I’ve tried thing like:
hit.transform.position to hit.collider.GameObject.transform.position

They all give me the parent world position.

Help!

SOLVED

I’m a noob! Its official, I’m a mess…

Changed the code to ‘hit.collider.gameObject.transform.position’ but did not change it in the Debug line … so I saw the wrong outcome in the console … .

:sweat_smile::sweat_smile::sweat_smile: