Need Urgent Help Pleaseeee (494285)

Hi All

I wants to run an walk animation in our project but it gives some problems. I am using animation.CrossFade("walking");
in update method but its runs continuously but after some delay round about 10 seconds. Actually I am using A model which contains 4 different animation like walking,jogging,standing from 1 to 500 frame. I want to use walking animation which exist in between 490 to 515 frame. Can you please help me to solve this issue…

using UnityEngine;

using System.Collections;

public class AnimationControl : MonoBehaviour {

	private Animation hunterAnim;
	
	// Use this for initialization
	void Start () {
	
		hunterAnim=transform.animation;
	
		hunterAnim.AddClip(hunterAnim.clip, "test1",1,239);
		
		hunterAnim.AddClip(hunterAnim.clip, "test2",250,489);
	
		hunterAnim.AddClip(hunterAnim.clip, "walking",490,515);
		
		hunterAnim.AddClip(hunterAnim.clip, "test3",520,538);
		
		hunterAnim.wrapMode = WrapMode.Loop;
		
		hunterAnim["shooting"].wrapMode= WrapMode.Once;
		
		hunterAnim["sitting"].wrapMode= WrapMode.Once;
		
		hunterAnim["jogging"].wrapMode= WrapMode.Once;
		
		hunterAnim["walking"].wrapMode= WrapMode.Loop;
		
		hunterAnim["walking"].layer = -1;
		
		hunterAnim.Stop();

	}
	
	// Update is called once per frame
	void Update () {
		
		hunterAnim.CrossFade("walking"f);
		
		}
	
	
}

I think if you used “Split Animation” in the “Import Setting dailog” would be easier to split your animation.it will help you to have multiple animations in a single file, you can split it into multiple clips.

and i think you need to put a idle animation in it also, else it will keep on walking. for example:

if (button pressed)
{
    animation.crossfade (walking);
}
else (button not pressed)
{
    animation.crossfade (idle);
}

Thank you so much hizral Its works fine now :slight_smile: