I have a character that I animated to do a yoga posture. The animation is activated upon button press (Red Yoga Symbol). Everything works great! I would like to take this one step further by “Wrapping” a UI button to the character’s lower back. My intention is for there to be no visible button, but once the lower back is clicked the animation will begin. Is it possible for the character to be a UI button?
Can I simply apply the same button script to “spine” in my hierarchy?
Code for Button
using UnityEngine;
using System.Collections;
using System;
public class Camel : MonoBehaviour {
Animator animator;
void Start () {
animator = GetComponent<Animator>();
}
public void Attack1 ()
{
animator.SetTrigger("Camel");
}
}