|
I would like to know how to set it up so when the user is holding their finger on the screen and their finger is over a certain object, that object will light up and if the finger slides off that object, it is no longer lit. If the finger is lifted off the screen while an object is lit up, then it becomes selected as if "touched" or "clicked". (aka "Touch Screen Mouse-over") I already have code in place for the PC version to where I am using "OnMouseEnter", "OnMouseLeave", etc. Are there equivalent built-in functions for mobile touch screen controls? If not, should I setup a raycast system or is there a better method? I should probably mention, I need the code in JS, not CS. Thanks!
(comments are locked)
|
|
Take a look at how Unity handles Mobile Input You can get access to an array of Input.Touches, and determine from those touches and gesture phases what exactly the user is doing. Well, with the PC or Mac, I can create a basic JS file with an "OnMouseDown" function and drop that script onto say an NPC character. Then whenever the player clicks on that NPC, it does whatever I want. I need basically the "touchscreen version" of that and I'm having trouble accessing the NPC from a raycast.
Sep 20 '11 at 04:48 AM
kingdutka
(comments are locked)
|

Urgently needed...