Animated Object Always Moves to (0, 0, 0)


I have an imported model which is meant to be “placeable” in the scene by the player. Basically the user can select the object from a menu then until it is placed, it follows the cursor on the floor, then remains in a certain place once the user clicks. This works completely fine for all my imported models apart from one. (The position of the object is determined by casting a ray from the camera to the cursor, then checking for collisions btw).

The model in question is a door and has an animation attached. Instead of following the mouse, it just stays at (0, 0, 0). Does anyone have any experience of such an issue? I have tried everything I can think of to solve this and have now spent two days on this alone.

I have created an empty gameobject that the animated model now resides inside. All other models are fine and if I remove the animation this door is also fine.

I know the object moves to (0, 0, 0) every frame, because the function I use to move the item (via the cursor) is called every frame. At the start of this function (called placeItem()) the position is found to be at (0, 0, 0) and at the end of the function the position is correct. All other objects use the same function and in their case the position at the start of the function is simply where the object was at the end of the previous function call. However the door object is constantly rendered at (0, 0, 0) regardless of framerate.

Any help at all will be incredibly useful!

Many thanks.

Did you try to test it with the animation disabled? If you can keep the object at the right location with the animation disabled, then your animation is modifying the object’s position, if this is the case and removing the object’s position curve is not an option, a possible solution is to embed your object inside an Empty GameObject, and then manipulate the container object.

Also, make sure you have one and only one animation controler in your object… wierd things happen when you have 2 or more.