Active Animation Framecount

  • #1, by sebastianSaturday, 22. August 2015, 18:38 9 years ago
    Hey Boys'n'Gurls,

    i want to count the frames of an active animation, but i get "nil" as a value .
    local framecount = getObject("ActiveAnimations["..game:getLink(VGameUsedItem):getName().."]"):getInt(VAnimationFrameCount)
    print(framecount) 
    


    Animation of the object has 2 Frames. I expected that i get this in return, but all i get is a "nil" when printing the int.

    Any ideas?

    EDIT:

    Meh... i know whats wrong. The AnimationFrameCount Value counts frames which are already passed. Not the total framecount. I'll do it otherwise then.... *_*

    thanks anyway

    ~Sebastian

    Thread Captain

    2346 Posts


  • #2, by constantinSaturday, 07. April 2018, 19:47 6 years ago
    how did you count the total amount of animation frames? 

    Forum Fan

    167 Posts

  • #3, by sebastianSaturday, 07. April 2018, 19:55 6 years ago
    Not sure anymore for what i wanted to use it here, but the "AnimationLastFrame" field should contain the  number of frames of the animation by default (unless you changed it via lua):

    VS5: framecount = ActiveAnimations["nameofanimation"].LastFrame

    Thread Captain

    2346 Posts

  • #4, by constantinSaturday, 07. April 2018, 19:58 6 years ago
    okay thank you.

    Forum Fan

    167 Posts