hi i would like to trigger a state animator.
i have set up a bool as in the “animate anything” tutorial.
but i would like to only have to click on the object.
here’s the state machine
i have set up a box collider on the object with this script.
using UnityEngine;
using System.Collections;
public class button_activator : MonoBehaviour {
private Animator animator;
void Awake () {
animator = GetComponent <Animator>;
}
void OnMouseDown (Collider other){
Animator.SetBool (pressed, true);
}
void OnMouseUp (Collider other){
Animator.SetBool (pressed, false);
}
}
but all my attempts get the thing not working
thanks