OnMouseDown question

Is it possible to have an event in one script that associates with a different collider?
Like,

OtherGameObject.OnMouseDown()

It would make my script cleaner.

Use a raycast that starts at the mouse’s position, and then execute the appropriate code for what ever the raycast hits.

This way, you don’t even need to use the OnMouseDown event.

1 Like

Woah I’ve never seen red text on these forums before. Cool :stuck_out_tongue:

Anyways, thanks for your reply. I have worked around this issue but will look into raycasting for future problems I encounter! Thanks again! :slight_smile:

1 Like

Very good! :smile:
I think that you learn more when you figure out problems on your own.

Sometimes though, a nudge is also helpful. :stuck_out_tongue:

Yeah. :slight_smile: