x


Touch Button Android

I put this script in the Button and Cube to Play the Cube animation when the button be touched, is a touch button script. What is Wrong, is not working! _________________________________________________________________________

var btnTexture : Texture; function OnGUI() {

if (!btnTexture) {
    Debug.LogError("Please assign a texture on the inspector");
    return;
}
if (GUI.Button(Rect(10,10,50,50),btnTexture))
    Debug.Log("Clicked the button with an image");
    animation["Play"].speed= 1.0;
    animation.Play("Play");

} function ResetAnimation(curAnim : AnimationState) {

yield WaitForSeconds(curAnim.length);
animation.Play("Idle");

}

alt text

PLay.jpg (56.2 kB)
more ▼

asked May 11, 2012 at 01:07 AM

gringofx gravatar image

gringofx
0 69 50 50

What are you trying to do with your cube? You need to be moreSpecific for us to help you? If you looking for simple up and down movement on button touch, that can be hard coded very easily?

Sep 23, 2013 at 09:41 PM bchilds88
(comments are locked)
10|3000 characters needed characters left

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x4432
x1237
x1089

asked: May 11, 2012 at 01:07 AM

Seen: 1394 times

Last Updated: Sep 23, 2013 at 09:41 PM