Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Hopefully Simple Scripting Question

Discussion in 'Animation' started by stonstad, Dec 12, 2021.

  1. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    658
    If we use animator.Play("stateName") to change to a specific state via script, how does one transition an animator to the the Entry node of a sub state machine? I tried animator.Play("stateMachineName.Entry") and animator.Play("stateMacineName"). The reason I would like to transition to Entry instead of a named state is because I have variables which determine which animation state should play within the state machine.

    Is there a specific API I should use?

    Thank you!
     
  2. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    658
    Last edited: Dec 13, 2021