Search Unity

How to create New States with animation clips on an Animator Controller ?

Discussion in 'Animation' started by DragonDark99, Jan 5, 2022.

  1. DragonDark99

    DragonDark99

    Joined:
    Jun 6, 2017
    Posts:
    10
    Is there a way to create (and destroy) New States by code and add those new states to an animator controller? for example: I have a player with an Animator Controller with just "Idle" and "Walk" Animations and I want to play an Animation Clip that it's stored in a variable and then return to the Idle or Walk Animation.
    I know I can just create that state with that clip before playing but I really want to know how to play animations without having to create a state for them previously.