Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: ENAY on July 13, 2012, 02:54:13 AM
-
Ok, I am using UICamera.selectedObject. After a button click I Debug.Log to see what is in the message and annoyingly it is always the previous message. So if I click on Button6 and then Button2, it will return Button6 instead of Button2.
Maybe I have my update in the wrong place. I am checking for button presses using onPress, does that mean I can't get the selectedObject until I release the button? (I want to have the result as soon as I press the button)
Any ideas?
-
Use UICamera.lastHit
-
I tried that before I posted and all I got was RayCast Hit all the time.
-
You need to filter how you like
i.e.: Uicamera.lastHit.transform.name
-
joreldraw!
You sir, are the man! 8)
Thanks for that.
-
Thanks, this is a great way around the weirdness of UICamera.selectedObject. UICamera.hoveredObject seems a bit easier to use, though. :D