Very complex button

Can a button be attached to a 3d object that has animation? For example, a character’s head can be clicked on in mid animation. Can someone please explain this to me, if it can be done?

If the player’s head has a collider attached to it, you can use:

  • OnMouseDown () is called when the mouse button is pressed while over the objects collider.

  • OnMouseUp () is called when the mouse button is released while over the objects collider.

  • OnMouseUpAsButon () is called when the mouse is released while over the objects collider after having been pressed down on the same collider.