- Home /
Is OnMouseDown the same with Raycast?
Sorry I'm new to Game Dev and no experience at all
On$$anonymous$$ouseDown is dependent to the Gameobject that has script attached while Raycast, you can detect any object if clicked based on tag/name/property etc combined with condition on mousebutton click and perform any action if it satisfies this condition
Answer by charlenedanes · Apr 01, 2018 at 12:01 AM
No it is not. :)
Thanks! But will they have the same function as On$$anonymous$$ouseDown can do with Raycast? Let's say destroy() On$$anonymous$$ouseDown and Destroy() on Raycast hit
On$$anonymous$$ouseDown involves clicking. RaycastHit is like On$$anonymous$$ouseOver. But yes they can do the same/have the same function if you will program it that way.
Your answer
![](https://koobas.hobune.stream/wayback/20220612155753im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Raycast and Hit Problem 0 Answers
Extend the Collider When Picking Up Objects 0 Answers
How to detect a mouse click on a line in 3d? 0 Answers
Raycast instantiating object to grid 0 Answers
dereference from a raycast 1 Answer