Search Unity

What are tags used for in the Animator window?

Discussion in 'Animation' started by Shadowing, Feb 20, 2015.

  1. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I notice you can give animation states tag names
    Does this allow to control a animation state by tag name?

    I'm wanting to make a animation scene for my character select window.
    Where you click a character and they do some animation.
    So I'm thinking I don't need animation transitions for this.

    Any thoughts that would help me
    If I can control animation states by tag name I can't find anywhere in the manual that talks about this.

    Anyone know of any resources for this

    thanks
     
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    Tag are user define data. A tag can be used to identify a state or a group of state.
    Are runtime you can query what is the tag of the current state.
    http://docs.unity3d.com/ScriptReference/AnimatorStateInfo.IsTag.html

    By example you could use tag to identify all your state that does control your combat mode and change the music to something with more drive or increase the volume.
     
    Maarti likes this.
  3. Alakanu

    Alakanu

    Joined:
    Oct 17, 2015
    Posts:
    5
    It would be very convenient to be able to query the animator for all the states with a tag. A lot of very basic, useful, and safe stuff of mecanim is hidden at runtime. Why is that? Do you have a rework on the roadmap? Mecanim is good to work with in the editor and quite a pain in the brain to work with at runtime.
     
    TheMemorius, modernator24 and Storm4_ like this.