Greetings all,
I am using a model made in blender. Unity told me that my animations can only be used as “legacy” so I am, though I do not know why that is the only usable option. I am controlling the animation from the update function of a javascript. When a button is pressed the model should move forward or backward and play the animation in forward or backward.
animation[ style[mode] ].speed = 1;
animation.CrossFade( style[mode] );
is the forward code and that works as expected however, when I press the other key to make it play in reverse it picks a keyframe near the end and freezes, it does not move while the button is pressed then it returns to my idle animation “CrossFade”
animation[ style[mode] ].speed = -1;
//animation[ style[mode] ].time = animation[style[mode]].length;
animation.CrossFade( style[mode] );
if i use
animation[ style[mode] ].time = animation[style[mode]].length;
then when i press and release the button everything works as expected however, when I press and hold the key the model jitters and plays only the first few frames of the animation. I believe this is due to the fact it is being done in the update loop and it is restarting from the end of the animation every frame, so the jitter makes sense but I need to be able to hold the button down. Is this some kind of conflict with the fact it is a “legacy” animation? Also is there a way to only play a few keyframesat a time? When it is walking forward and I release the button it finishes the animation (walk cycle). Also I have the model moving on the x axis, it is facing in the x axis and I am giving it the forward direction, but the inspector says it is moving on the z axis as well. I put him on the egde of a plane and if he were truely moving on the z axis he would fall off, but he does not. Watching the inspector values the z axis will climb to -10 then jump down to 0 repeatedly, while moving in one direction on the x axis. Is that ok? I don’t know if I should have written several separate questions and if so I appologize.