Announcement

Collapse
No announcement yet.

How to stop animation?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How to stop animation?

    Hello! I'm using UDK Script just a few days. I play my animation without using AnimNode, i use Blend.

    Code:
    simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
    {
    	super.PostInitAnimTree(SkelComp);
    
    	if (SkelComp == Mesh)
    	{
    		isAttack = AnimNodeBlendList(SkelComp.FindAnimNode('isAttack'));
    		isAttack.SetActiveChild(1, 0.01f);
    	}
    }
    isAttack - Node Name.

    It's playing but i don't know how to stop it?)

    I need to play in once and stop.
    Thank you!

    #2
    in your animtree in udk editor select your anim sequence and un check loop check box

    Comment


      #3
      Originally posted by alisahaf70 View Post
      in your animtree in udk editor select your anim sequence and un check loop check box
      Thank you. It's need to, but i need to stop it by some function or state like "FinishAnim" to see when it stop and run other animation. Now i'm trying to run animation by using AnimNodeSequence, but it's not working

      Comment


        #4
        I need to stop these animation in code
        Code:
        simulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
        {
        	super.PostInitAnimTree(SkelComp);
        
        	isAttack = AnimNodeBlendList(SkelComp.FindAnimNode('Attack'));
        	isAttack.SetActiveChild(1, 0.01f);
        }
        and then run another animation, the same way, or other if there are some ways.

        Comment


          #5
          Guys help please

          Comment


            #6
            use isAttack.StopAnim();

            Comment


              #7
              Originally posted by alisahaf70 View Post
              use isAttack.StopAnim();
              Great! Works! But it stops animation earlier than it finished. I try to change time of playing "isAttack.SetActiveChild(1, 0.01f);", it works, plays faster or slower, but still finished earlier that it need.

              Comment


                #8
                sorry i cant understand please explain more about your purpose and say what do you want to do exactly
                tnx

                Comment


                  #9
                  you can wait in your class state until anim seq finish the animation with finishanim(animseq)

                  native(261) final latent function FinishAnim( AnimNodeSequence SeqNode, optional bool bFinishOnBlendOut );

                  or u can use timer

                  Comment


                    #10
                    Originally posted by alisahaf70 View Post
                    sorry i cant understand please explain more about your purpose and say what do you want to do exactly
                    tnx
                    Sorry for my English
                    I need to run one animation, stop it, in code of course, and then run another.

                    Comment


                      #11
                      you speak better than me i promise

                      i highly recommend you to use animnodeslot or custom anim play node

                      but if u persistence on using blendlist you must do this

                      set anim sequence animation
                      blend to that child
                      if u write your code in state or latent function use finishanim function or if u write your code in normal function use onanimend event or timer to find when animation finish
                      then change anim seq animation & blend

                      u must access to animnodeblendlist and animnodesequence of your anim tree in code

                      but i say that again i highly recommend you to use animnodeslot or custom anim play node because in these condition u cant blend normally

                      Comment


                        #12
                        Originally posted by alisahaf70 View Post
                        you speak better than me i promise

                        i highly recommend you to use animnodeslot or custom anim play node

                        but if u persistence on using blendlist you must do this

                        set anim sequence animation
                        blend to that child
                        if u write your code in state or latent function use finishanim function or if u write your code in normal function use onanimend event or timer to find when animation finish
                        then change anim seq animation & blend

                        u must access to animnodeblendlist and animnodesequence of your anim tree in code

                        but i say that again i highly recommend you to use animnodeslot or custom anim play node because in these condition u cant blend normally
                        hm, Thanks i'll try

                        Comment

                        Working...
                        X