- Home /
The question is answered, right answer was accepted
How to control animated bones of an FBX file?
Hi, I was wondering what the proper workflow is for accessing bones of an animated hierarchy saved as an fbx.
I have an animated tower, every object has a key on every frame. In code I aim the towers gun at a target. this however does not work properly since the animation that is played on the tower overrides what i do in code. My part solution was to add an extra controller object in unity into the hierarchy which has the gun as a child. now i have controll back over the orientation of the gun, however the animation is "lost" or disconnected.
The animation window even tells me that the curves are "Leftover" however i dont know how to relink them to the apropriet bone.
Is there a way to avoid said problem? Is it possible to export an fbx that only has certain curves of an object animated while the others are blank, or do i need to delete some curves, is that even possible with a read only fbx?
The animation of the tower is split on import, if that changes anything.
Answer by Paulius-Liekis · Jul 18, 2012 at 09:49 AM
The usual approach:
Play animation on the tower just as any animation
Make adjustments to the orientation of the turret in LateUpdate (not in Update), because it happens after sampling animation and this way you can override transform values.
sorry for the late reply and thanks for the reply. this sounds like the solution i was looking for!
Answer by Bunny83 · Jul 18, 2012 at 10:29 AM
The general advise is, do not animate the root bone. If you do this, you have to make the "whole" model a child of another object. Don't break up the bone hierarchy. Another way is to set a mixing tranform to effectively ignoring some curves. Another way is to remove the animation curves in your modelling application, or create duplicates of the animations in Unity (CTRL + D), replace the animations in the animation component and edit the animation in Unity.
hey, sorry for the late reply, this sounds a bit over complicated for my scene. I will look into mixing transform though it sounds interesting. thanks