I am wondering how I can get the gameobject of the object my ray cast hit? the transforms parent dosent give it.
thanks
I am wondering how I can get the gameobject of the object my ray cast hit? the transforms parent dosent give it.
thanks
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
An example to easy things: if (Physics.Raycast(cam.ScreenPointToRay(...), hit){ Destroy(hit.transform.gameObject); }
– aldonalettopublic override bool IsEnabledAndSupported(PostProcessRenderContext context) { TextureOverlayRenderer.Render(context);// not sure if this is the problem.. return enabled.value && (overlayTexture != null) && (opacity>0); }
– zereda-games