I can i disable or enable raycast target via script?

I can i disable or enable raycast target via script?

By “target”, do you mean the object that the raycast has hit?
If so, yes.

This, but IDK

8120954--1052558--Captura de pantalla 2022-05-12 012258.png

I can’t tell what that component is from the image, but I’m going to guess it’s a MaskableGraphic?
Yes, its raycastTarget can be enabled/disabled via script if so.


IDK what is it, but where i can find this info?

It’s an Image component.
You can find the documentation here:

1 Like

oh ok thanks, but it isn’t posible no?

Yes, it is possible to set the raycastTarget via script.

1 Like