Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Issues with applying internal animation using statemachine behaviour in Animator

Discussion in 'Animation' started by ebosman, Aug 29, 2023.

  1. ebosman

    ebosman

    Joined:
    Feb 3, 2020
    Posts:
    1
    I have an FBX file with a model of a barrier that can open and close, the FBX includes an animation with the closing animation. I have a seperated json file with the different transitions and states of the barrier. I have created an editor script that creates the animator with the correct states, transitions and triggers to fire the transitions (see image).

    upload_2023-8-29_13-28-54.png

    I have applied the internal animation as a motion on the states with (what I assume to be) the correct settings:
    • upload_2023-8-29_11-56-0.png
      • Here I expect the barrier to be set as closed by taking the final motion frame and speed 0 (does not work, barriers resets to original position when transitioning to next state)
    • upload_2023-8-29_11-56-14.png
      • Here I expect the barrier to be play the motion inverse (that works)
    • upload_2023-8-29_11-56-45.png
      • Here I expect the barrier to be set as open by taking the first motion frame and speed 0 (does not work, barriers resets to original position when transitioning to next state)
    • upload_2023-8-29_11-57-16.png
      • Here I expect the barrier to be play the motion (that works)
    I have read some information about applying the root motion of the animation and I have tried pretty much all settings, but I can't seem to figure it out. I have worked with Unity for years, but the Animator is relatively new to me.
    I hope somebody could point me in the right direction here. I have a feeling that it's not complicated what I want, but I have not found the best method yet.
    Thanks in advance!
     
    Last edited: Aug 29, 2023