hello beautiful people,
I’m trying to make a GUI.texture button that when pressed, it plays an animation of the player bringing his arm up after it plays it goes idle, and when the button is pressed again it plays the animation of the arm going down. I currently have four animations (Arm_Up_Idle, Arm_down_Idle, Arm_transit_up, Arm_transit_down)
I’ve tried getting the button to work and I can’t even figure that out. this is what I’ve got:
public class ButtonGUITouch : MonoBehaviour {
public Color GUI01;
public Color GUI02;
void Start(){
GUI01 = this.guiTexture.color;
}
void Update(){
if (Input.touches.Length < 0) {
for (int i = 0; i <= Input.touches.Length; i++) {
if(this.guiTexture.HitTest(Input.GetTouch(i).position))
Debug.Log ("HELLO MUNDO");
}
}
}
}
I’ve been trying to figure this out for days now but cant get anything. Any help whatsoever will be amazing and credit will be given to where its do!