raycast colliders - problem?

Sorry for a possibly ignorant question. :wink:
Here we go:

I need to determine a click location anywhere within the scene on a few occasions. Checking for a mouseup/“fire” and doing a raycast would be the logical way I guess. However, as far as I can tell, raycast only triggers hits on objects with a collider.

Sure, I can set up a box collider set to trigger to collect the raycasts, but I’m worried about a performance penalty.
The box collider(s) set up for this purpose are likely to intersect other game objects (frequently), and will then (I assume) trigger calls. Will this affect performance?

Is there any other (more effecient) way to determine what the player has clicked on, and where?

Many thanks in advance!

PS…yes, I did search. :wink:

Yes, if you want a raycast to hit something, it has to have a collider. Make it a trigger collider for best efficiency (it won’t cause events to trigger if it hits another trigger collider, at least unless one of the two has a rigidbody) If there’s no script with OnTriggerWhatever implemented to receive the calls, I don’t believe they’re sent, either.

Don’t worry too much about performance - unless you have an extreme amout of colliders, the performance impact should be negligible.

Excellent! Many thanks! :slight_smile: