Search Unity

Animation window curve objects all showing up yellow and animation wont play when...

Discussion in 'Animation' started by Galactic_Muffin, Mar 6, 2015.

  1. Galactic_Muffin

    Galactic_Muffin

    Joined:
    Aug 14, 2013
    Posts:
    67
    Hey everyone! :D
    So I finally finished the animations for a fancy Ugui in world space Im working on, however i'm encountering some weird behavior; Ive added an animator to the parent empty game object that all the animated UI elements are on. when i select the game object with the animator attached or any child objects to that game object, all my animated UI elements or curves int he animation window turn yellow and the animation no longer plays. it only works if i select any game object above the one with the animator attached.

    Here are some screenshots of what is happening and descriptions:

    As you can see, this is how the animation pannel looks when i am selected on the canvas. the animations play fine. The canvas has my script attached that i will use to toggle between he animations however I had to make another empty game object to attach the animator on because on any object that has the animator attached, this happens:


    as you can see, all the curve elements that I am animating turn yellow when the game object with the Animator component and children of that game object are selected and when this happens neither of the animations will play...


    in fact the animation file itself when added to a state in MechaAnim, will not animate in preview. no form of the animation works unless i select a game object that does not have an animator attatched for whatever reason.


    I feel like it's some kind of disconnect from the assets but it makes no sense, to me anyway. I feel like i may be missing a step or possibly did the order of something wrong when i set everything up.

    Any ideas on what is happening and could it be a problem when I activate the animation in code?
     
    Last edited: Mar 6, 2015
  2. Mecanim-Dev

    Mecanim-Dev

    Joined:
    Nov 26, 2012
    Posts:
    1,675
    I'm no sure what going on.

    Can you please log a bug with your project so we can investigate what going on?

    Best regards,
     
  3. Galactic_Muffin

    Galactic_Muffin

    Joined:
    Aug 14, 2013
    Posts:
    67
    Thanks mechanim.dev! But I think I found a solution and turns out it is a common problem that most people don't know how to fix. So i'll go over what i did to fix it incase anyone else runs into this problem. :)
    Typical rule of thumb when animating in unity, be very careful where unity creates or you create your animation controller on. if you start building your animation with the wrong controller, or have your controller on the wrong game object, you will not be able to move that controller on a different game object after you have made the animations. but if this does happen to you and you have made an elaborate animation that you would rather not redo, here is how you fix the problem:

    We will be editing the actual animation files so make sure you have your original animations duplicated so you have a backup:

    so we want to open these animation files in a notepad application but if you did that, you would most likely get a long list of binary, so to convert it to something we can actually read, just open up your editor settings and change Asset Serialization to "Force Text".


    Now we can go ahead and open these animation files in Notepad. once you have them open scroll down the animation file untill you find the "path" we want to replace the game object that the path is assigned to in this file with nothing. so do a find < Replace All and replace everywhere it says the first game object in your path to nothing (and remember to include the first / when replacing all). This will enable you to move your animator component to any game object parented to the objects you are animating:



    After you have completed this you may delete the original animation files and you can re-hook your new edited animation files into your animator and you can move your controller. :)
     
    Last edited: Mar 6, 2015
  4. Halleester

    Halleester

    Joined:
    Sep 5, 2014
    Posts:
    1
    Are you sure there isn't a step that you are forgetting to share? I have the same problem, but when I save the text file, it no longer is an animation in unity, even though it is still saved as .anim
     
  5. daneArmada3D

    daneArmada3D

    Joined:
    Jun 1, 2016
    Posts:
    1
    praise be to GalacticMuffin!
     
    Galactic_Muffin likes this.
  6. Galactic_Muffin

    Galactic_Muffin

    Joined:
    Aug 14, 2013
    Posts:
    67
    It could be that you accidentally messed up the formatting or deleted a line in the file when you were editing it. You have to be very careful not to change anything ales but the names and spell everything correctly otherwise the file may be unrecognizable to unity. Thats why you want to make sure you have made copies of all your animation files before editing them in sublime or another text editor. :)