I was getting some strange behavior when exporting an animation in which I used a “link constraint” (animation controller that temporarily links one object to another) in 3ds max. This is useful when you want to animate, for instance, a screwdriver sitting on a table, then being picked up by a person, and you want the screwdriver to stay in the hand of the person and follow it around (without having to set a bunch of extra keys on the screwdriver).
Anyway, I found that the animation does not import properly into Unity until you check the “Bake Animation” option in Unity (look for it near the animation options when you click on the asset).
I couldn’t find any other documentation that says to do this, so I thought I’d post here in case anyone else is looking for the answer!
Hi Quantico,
I Think the animation view and specifically animation events could help you out with this.
the link constraint is unfortunately not supported by the FBX format so that is out of the question. But setting up a script that parents the screwdriver to the hand bone(and removes the link) is certainly a possibility.
So here is the code you will need to achieve something like this (not necessarily the BEST code for the job but
)
var handParent : Transform;
var objectToPickup : Transform;
function pickUpObject ()
{
objectToPickup.parent = handParent;
}
function dropObject () {
objectToPickup.parent = null;
}
ok so you add that script to your character (that has the animation component on it) add your “hand” and your “object to pick up” to the list and then simply add animation events to the animation clip that pickup or drop the object
simples.
thinking about this, I could actually make this better by allowing you to simply define what the “hand” object is and then drag and drop the object you wish to pick up into the function… but still… its late… I need sleep 