Stop animation in specific frame

  • #30, by sebastianThursday, 28. February 2019, 17:13 4 years 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

    b = number of frame b

    Thread Captain

    2346 Posts

  • #31, by afrlmeThursday, 28. February 2019, 17:15 4 years 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.


    7221 Posts

  • #32, by zurikMonday, 08. April 2019, 15:00 4 years 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

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


    40 Posts

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

    ActiveAnimations["example"].PlayOppositeDirection = true

    true = reverse, false = forward.


    7221 Posts