- Home /
animation window, yellow text after moving Animation component
after moving my animation component for my character from his hands(don't ask, i don't know why i put it there) to the top of his hierarchy, all the animations have missing properties. they are all yellow now and no animations work. is there a way to re-link all my game objects back into it. they didn't go anywhere, every animated object is still there, the main component just moved up the hierarchy. this would save me alot of time, otherwise ill have to reanimate a couple animations.
edit: i just realized the animation component doesn't see them because they aren't directly children of the object the component is on, so i guess that answers me question. although if i could link them without having to move the animated objects up the hierarchy that would be best.
i copied and pasted the transform values over for the keyframes, took a while but i resolved my issue. i guess ill just leave this open though if someone has a more elegant quicker solution they can answer it i guess.
Answer by MuHaGames_Avee · Mar 03, 2017 at 06:16 PM
You actually can relink animations even if animated objects are moved deeper into the hierarchy. You just need to click twice on the name of the missing object (in Animation panel) - note that normal double click won't do it, you have to click once and then again shortly after, just as if you were renaming a file. This will let you edit the object name. If you want to point to an object deeper in hierarchy, simply use / character, just as you would do with files and folders, i.e. change "Tree" to "Forest/Tree" if you moved the Tree game object inside Forest game object. You will see the indentation on the Animation's object list change slightly and the animation will start working again.
Another method I've discovered, which may be even better if there are several bones to relink: 1. If you already have a standalone .anim file, skip to step 2. Otherwise, if the animation is i.e. a part of an .fbx, first duplicate it with Ctrl+D - this will create a standalone .anim and ensure you do not make a mess in the model itself. 2. Open the .anim file with a text editor (Notepad++ works good for me). Look for lines that start with path: and just do a Find & Replace action on the bones you need to rename. 3. Save the .anim and go back to Unity - it will reload the animation.
Hey, I was able to figure out the "/" part, but what if the object is indented too far and you need to bring it back out? I can't find the character or method to do that! Do you know?
Can you give an example of your hierarchy structure and what you are changing?
Basically, I have FBX animation I am re-purposing and trying to copy over to new, editable clips. Part of the re-purposing is that the hierarchy can be changed, which is the cause of this issue.
I've noticed that I can use the "/" character when rena$$anonymous$$g the object reference to move deeper and to map to children, but sometimes the properties come in already at a child level and I actually need to move them back towards the root level to get the reference to work right.
I can't figure out how to move them out rather than in. For example, if you use the "/" character to move further in to the child levels, you can't seem to ever move them back out. Is there a character I can use the essentially does the exact opposite of the "/" character?
I mean, right now I can still re-use the animation, but I have to create a new property of the same type and then copy and paste the keys from the broken property to the new one. It's not the end of the world, but if I could just move the originally pasted in property 1 level towards the root it would just work and save me a step. When I have to do this many times over and over it would end up saving me a lot of time if there was an opposite character to the "/"
Try putting ../ before the name of the game object, this should move it closer in hierarchy.
Oh nice! The shortcut for rename in windows, F2, helps too! Not sure of the $$anonymous$$ac equivalent.
Oh thanks a lot for this info. You saved my hours. In my case the problem was that whenever I apply same animator to the new character then some gameobjects got unlinked. Then after reading your answer I realized this was because the name of the same game object in new character was different than previous character, though the hierarchy level and every thing else was identical. I renamed the object and it instantly recognized. Thanks again.
Answer by planny · Jun 19, 2018 at 04:43 AM
Continuing what @MuHaGames_Avee was talking about, you can just simply press "F2" as if you are renaming something to change the child of the object.
How it works is like a file system, for example "FPSCamera/Weapons/Slot1/shotgun/..." etc. Quickly adding a key frame for the new child you want and pressing F2 on it is a good way to get the path you want as well.
Your answer