3 Replies Latest reply: Nov 27, 2011 11:41 AM by tyree_2 RSS

    play thru

    tyree_2 Community Member

      Im trying to get an animation to play frame by frame by keydown. the problem is, it only plays the first two frames and doesnt increment to the last frame 

       

       

      on keyDown

        if (_key.key = "p") then

          member(1).model("group01").bonesplayer.currenttime=0

        end if

       

        if member(1).model("group01").bonesplayer.currenttime<1699 then

          member(1).model("group01").bonesplayer.currenttime=+1

        end if 

      end

        • 1. Re: play thru
          SeanWilson Community Member

          Lingo doesn't use the '+=1' construct that other languages understand, so your if statement might be reconstructed as:

            tCurrentTime = member(1).model("group01").bonesplayer.currenttime
            if tCurrentTime < 1699 then
              member(1).model("group01").bonesplayer.currenttime = tCurrentTime + 1
            end if
          
          • 2. Re: play thru
            tyree_2 Community Member

            thanks for that, I was unaware of lingo not using +1 partially because no error was thrown. I havent tried the code yet, but without director throwing an error I had no idea of a syntax problem

            • 3. Re: play thru
              tyree_2 Community Member

              I tried it and that indeed worked, but a side effect happened. I use the arrow keys to control the character position. after using the currentime code, now the arrow keys speed up the animation and cause it to play faster. no engine really supports frame by frame animation. so its not completely surprising it doesnt work properly.

               

              for whatever reason the current time code is being triggered by the arrow keys. despite being set to the p key