I want an the first position and orientation of a FBX animation to match to the last ones of the previous animation by the following script.
void Start() {
prevLastPos = new Vector3[animName.Length-1];
prevLastAng = new Quaternion[animName.Length-1];
for(int i = 0; i < animName.Length-1; i++){
animation[animName*].enabled = true;*
_animation[animName*].weight = 1.0f;*_
<em>_animation[animName*].normalizedTime = 1.0f;*_</em>
<em>_*animation.Sample();*_</em>
<em><em>_prevLastPos *= transform.position;*_</em></em>
<em><em><em>_prevLastAng *= transform.rotation;*_</em></em></em>
<em><em><em><em>_animation[animName*].enabled = false;*_</em></em></em></em>
<em><em><em><em>_*}*_</em></em></em></em>
<em><em><em><em>_*}*_</em></em></em></em>
<em><em><em><em>_*void Update () {*_</em></em></em></em>
<em><em><em><em>_*if(!animation.isPlaying){*_</em></em></em></em>
<em><em><em><em>_*if(curAnim > 0){*_</em></em></em></em>
<em><em><em><em>_*transform.position = prevLastPos[curAnim-1];*_</em></em></em></em>
<em><em><em><em>_*transform.rotation = prevLastAng[curAnim-1];*_</em></em></em></em>
<em><em><em><em>_*}*_</em></em></em></em>
<em><em><em><em>_*animation.Play(animName[curAnim]);*_</em></em></em></em>
<em><em><em><em>_*curAnim++;*_</em></em></em></em>
<em><em><em><em>_*if(curAnim == animName.Length) curAnim = 0;*_</em></em></em></em>
<em><em><em><em>_*}*_</em></em></em></em>
<em><em><em><em>_*}*_</em></em></em></em>
<em><em><em><em>_*```*_</em></em></em></em>
<em><em><em><em>_*But it doesn't work. Appropriate values cannot be assigned in prevLastPos[] and prevLatAng[]. Does anyone know how to solve this problem?*_</em></em></em></em>