Why are my animated objects (from Blender) always playing at the global origin in Unity?

Why are my animated objects (from Blender) always playing at the global origin in Unity?

I created and animated a sledgehammer in Blender 2.67b using an armature. The sledgehammer has one animation (created using the Action Editor) called "Idle". I parented the imported sledgehammer to an empty GameObject and set the sledgehammer's position to (0, 0, 0). I then moved the parent GameObject to where I want it in the scene. When I launch the game, the animation plays but the sledgehammer child always re-positions itself to be at the global origin, no matter where I place the parent GameObject. See the image below:

Notice how the sledgehammer's position goes from (0, 0, 0) to (-1087, -3, -1149).
The armature has a single bone and has the sledgehammer object as a child. I've spent about 4 hours looking this up on the Internet, but it seems like parenting the animated mesh to an empty GameObject worked for everyone else except me. Anyone else experience this? I've tried both .fbx and .blend files.

Solutions/Answers:

Answer 1:

You can solve this programatically for now. A small script will update the position before the draw call to keep the sledgehammer in the position of your Parented game object. Drag the GameObject parent onto the inspector after applying this script:

UnityScript:

#pragma strict

var localOrigin : GameObject;

function Start () {
    transform.position = localOrigin.transform.position;
}

function LateUpdate () {
    transform.position = localOrigin.transform.position;
}

C#

public GameObject localOrigin;

void Start () {
    transform.position = localOrigin.transform.position;
}

void LateUpdate () {
    transform.position = localOrigin.transform.position;
}

Hope it helps.

References