Stop animation in specific frame

  • #30, by sebastianThursday, 28. February, 17:13 5 months ago
    Hi. What I am trying to do is to play the animation from A to B and stop in on the B frame. And I can't make it whatever I try grin

    In Frame B, edit that frame and add an "execute a script "action part.
    Enter this inside:

     ActiveAnimations["animation name"].FirstFrame = b
     ActiveAnimations["animation name"].LastFrame = b
    1
    2

    b = number of frame b

    Thread Captain

    2315 Posts


  • #31, by AFRLmeThursday, 28. February, 17:15 5 months ago
    Quick tip: you can edit animation frames & insert action parts/execute a scripts into them, so edit the frame you want it to pause on & create an execute a script action part & use the setAnimFrames() function to force it to loop that frame.

    Alternatively, you could just create the animation up to the frame you want, then create another scene object that you link a condition or value to. The linked condition/value will determine if the scene object should be visible/active or invisible/inactive. You would play the animation, then set the condition/value to the desired value to show the scene object.

    Imperator

    6573 Posts

  • #32, by zurikMonday, 08. April, 15:00 3 months ago
    Thanks, guys. I managed to play and stop a longer animation on specific frames, but I now wonder if you can help me with the following:
    How can I play the same longer animation in reverse?

    Now I start and stop the animation with this script:

    function setAnimFrames(anim, a, b)
     if b == nil then b = a end -- fallback in case only a value was entered
     ActiveAnimations[anim].AnimationFirstFrame = a 
     ActiveAnimations[anim].AnimationLastFrame = b
    end

    but how can I tell it to play in reverse? (Imagine a fuel status bar that fills up and then reduces)

    Newbie

    34 Posts

  • #33, by AFRLmeMonday, 08. April, 15:21 3 months ago
    You can toggle the play direction of an active animation (animation that is playing) like so...

    ActiveAnimations["example"].PlayOppositeDirection = true
    1


    true = reverse, false = forward.

    Imperator

    6573 Posts

Write post