- Home /
Question by
UDN_36b35994-ec3a-45c4-9ac0-c73736e88e44 · Oct 01, 2016 at 06:57 AM ·
uicanvasraycastingraycasthitname
Get name of UI element by RayCasting
I want to find out the name of an UI element when I click on to it with my mouse. It's easy with 3D objects that aren't on the canvas but the same method doesn't work with UI elements unfortunately, even if I attach a box collider to the UI. I've been looking all around the internet for hours now and just can't find a good answer of this.
Comment
Answer by Happy-Zomby · Oct 01, 2016 at 07:41 AM
Hi, I believe you need to use a graphicraycaster. see here: http://gamedev.stackexchange.com/questions/93592/graphics-raycaster-of-unity-how-does-it-work
hope that helps,