- Home /
Question by
NickP_2 · Jan 09, 2014 at 11:01 AM ·
androidtouchguitexture
Move guiTexture along touch position
I have a guiTexture and I'd like it to move along with the touch position of my finger, but only when the start touch position was on the texture.I'm using it to pull back the string of a bow, and when the touch is released, the bow shoots the arrow with a force depending on the position between the end- and startpoint of the touch.
The code I've got so far:
if (touch.phase == TouchPhase.Began && guiTexture.HitTest(touch.position))
{
//start the pullback of the bow animation
}
if (touch.phase == TouchPhase.Ended)
{
//start the shoot animation and launch an arrow, based on the distance between the end and start position of the touch
}
I figured out everything, except I'm having troubles with making the guiTexture of the "shootbutton" follow my finger (and only on the y axis: down)
Thanks
Comment
Your answer
Follow this Question
Related Questions
GUITexture touch play animation 0 Answers
GUITexture Touch Problem 2 Answers
GUITexture Button Help, Android touch 2 Answers
Disable gui texture in a different way? 0 Answers
GUITexture and Touch Input 1 Answer