Getting gameobject from raycast hit

I am wondering how I can get the gameobject of the object my ray cast hit? the transforms parent dosent give it.


Well… you look up RaycastHit and see you can use .transform to get the Transform. You next look up Transform and see that gameObject is one of it’s variables. So there you go.

RaycastHit.transform.gameObject : GameObject