- Home /
Child doesn't play animation. Any help?
I) Introduction
Good night everyone,
First of all, I would like to apologize for any grammar/orthography mistake. English is not my native language. Having said that, lets start:
II) General problem description
I have a game object called "gun" with 5 children. One of these ("left hand") doesn't play an animation, but the rest of the children does.
III) Detailed problem description
I made a gun in blender and imported it to Unity. Then, I made a prefab which has an empty game object (for scripting purposes) as parent with the gun parts and two hands ("left" and "right" hand, made with cubes) as children, all with the same level in the hierarchy. Later, I made some animations, like "Fire", "Idle" and "Reload" with this prefab. The problem comes when I play the "Reload" animation in-game. All the children play the animation but "left hand" doesn't. This only happens in the "Reload" animation, the other animations play properly.
According to the animation window, the "gun" game object should do this (Youtube video), but in-game the gun only do this (the "left hand" doesn't play the anim).
IV) Additional info
No changes were made to the hierarchy while making the animations. I checked this by re-making the animation or making other anim, but the problem with the left hand wasn't fixed.
I made ridicolous changes to the "Position", "Rotation" and "Is active" properties in the "Reload" animation. Nor "Position" or "Rotation" were affected in-game (but did in the animation window) but the "Is active" property did have a change in-game.
After erasing the "left hand" curves in the animation window, the left hand game object had the same effect in the animation window as in the in-game problem. This took me to think that the left hand isn't playing any anim (Duh!) and it is not only making a random anim.
The left and right hands have the same properties in the inspector.
The left hand is a non-static object (Inspector).
In other anims, the left hand seems to have no problem (because it only makes a small amount of anim so I can't tell if it is making something that it shouldn't).
The animation component is attached to the parent.
Yes, this is my first question. Thank you for having read all the question 'till here. Have a nice day.
Answer by AfrOn · Jan 28, 2015 at 06:26 AM
I have just fix it. Because the "left hand" was originally a copy of the "right hand" with a different name, I tried by creating a new "left hand" gameobject. It works fine now.