Raycasting not detecting collider
Hi,
I want an action to occur when I click on a sprite in the scene, so I attempted to do it with Raycasting. I'm following tutorials online line-for-line, but for some reason a collision hit is never detected even when I click the object. Why might this be?
Above is my script. When I click on the sprite in play mode, "Right Click Detected" is printed but not "Collision Detected". On the ColliderTest object I have a sprite, circle collider, and this script attached:
(and the transform, not shown)
Your answer
Follow this Question
Related Questions
I need to make rayscast in four edge areas depending on the direction 0 Answers
Raycast not always detecting floor 1 Answer
Raycast does not seem to properly detect object it hit 0 Answers
Unity 2D does not detect collisions 0 Answers
NullReferenceException: Object Reference not set to an instance of an object 0 Answers