Quantcast
Channel: Answers for "Detecting Mouse Click on 2D Sprite"
Viewing all articles
Browse latest Browse all 8

Answer by rosdi

$
0
0
The only way for this to work, apart from making sure there is `Collider` component, is to make sure the `Z` index of the object is on top, even if you are making 2D games. The sorting layer is ignored and Z index take precedence instead. So this means you may not be able to attach your sprite under another game object. I tried parenting my sprite under another game object and my mouse click is no longer detected.

Viewing all articles
Browse latest Browse all 8

Latest Images

Trending Articles





Latest Images