Search Unity

Add new empty state in animator at runtime

Discussion in 'Animation' started by BionicBall, Mar 24, 2021.

  1. BionicBall

    BionicBall

    Joined:
    Oct 1, 2018
    Posts:
    1
    Hello!

    Is there a way to add new states in animator by not using AnimatorStateMachine.AddState? This only works in editor and I can't find a way to do this in order to get this working in build.
     
  2. Kybernetik

    Kybernetik

    Joined:
    Jan 3, 2013
    Posts:
    2,570
    No, you can't modify Animator Controllers at runtime.

    But you might be interested in Animancer (link in my signature) which lets you avoid Animator Controllers and do everything in scripts at runtime.
     
    BionicBall likes this.