Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Can't assign a motion to an animation state

Discussion in 'Scripting' started by thevvulf, Mar 27, 2022.

  1. thevvulf

    thevvulf

    Joined:
    Oct 31, 2020
    Posts:
    36
    I feel like I should preface this with the fact that I rarely use Unitys animation system and don't know almost anything about it, so keep that in mind. I have 2 animation clips, "SwordIdle" and "SwordSwing", you can infer what each of these are for.
    I made an animation controller with the Entry state going directly to the SwordIdle animation, which I drag and dropped into the animation controller from the project window. I added an Animator component to the sword, and set the Controller field to my animation controller.
    I pressed play and expected my sword to be in the idle animation, since I set the Entry state to go into the SwordIdle animation, but nothing happened.
    I looked at the SwordIdle state and under the Motion field, it said none. So I clicked the little circle to the right of the field, clicked the SwordIdle animation clip, but nothing happened. I tried dragging the idle animation clip directly into the motion field but it did nothing.
    I'm assuming this is why the animations won't play, so its pretty important. I did a lot of googling and nothing has worked, and maybe 3 similar questions even showed up. upload_2022-3-26_23-5-33.png
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    777
    Hi,

    Perhaps your sword isn't rigged, or the animation clips expects another hierarchy, or other transform names, for the animation?
    Suggests you open up the Animation window to see what's going on.
     
  3. thevvulf

    thevvulf

    Joined:
    Oct 31, 2020
    Posts:
    36
    The sword has no rigging from Blender. Its just 3 meshes exported as .fbx. All the animation is being done in Unity.
     
  4. AnimalMan

    AnimalMan

    Joined:
    Apr 1, 2018
    Posts:
    1,164
    The hierarchy needs exact names of the animation. Don’t open animator open animation window while selecting the game object object with the animator attached to see if the animation window has any errors in hierarchy names.
     
  5. thevvulf

    thevvulf

    Joined:
    Oct 31, 2020
    Posts:
    36
    Sorry but I have no clue what you just said.
     
  6. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    777