Announcement

Collapse
No announcement yet.

2D: problem playing flipbooks in sequence

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

    2D: problem playing flipbooks in sequence

    Hi, I'm kinda new at this and working on a 2D project.
    In my character states, I'd like to play a flipbook when another has finished playing. Currently I'm doing this with sequences and delays (image below), but I have a feeling this isn't ideal. Is there a better way?

    Possibly related question: I'd also like to stop some flipbooks when they reach their final frame. I've dabbled with the "Set Looping" and "Stop" sprite functions but it's a bit hit-and-miss, and I'm unable to find much about them in the documentation.
    Thanks for any ideas!

    Click image for larger version

Name:	damagmagamage.png
Views:	1
Size:	124.8 KB
ID:	1162040

    #2
    These links might help you out.

    https://forums.unrealengine.com/show...or-4-3-Preview

    https://forums.unrealengine.com/show...D&highlight=2d

    Comment


      #3
      I've been reading for weeks and absorbed many hours of video but I guess I came here primarily looking for feedback/advice on my method from anyone with more experience than I. Any thoughts? Thanks for the links.

      Comment


        #4
        I check frame numbers to know when a flipbook has reached a certain frame.

        I currently am doing this in code but
        flipbookframe = GetSprite()->GetPlaybackPositionInFrames();

        if (flipbookframe >= 7)
        {

        //reset attacking state
        isAttacking = false;
        AttackAnimationPlaying = false;
        canMove = true;
        numOfSwings++;
        }


        that's just an example and cut out pieces of my code to give you an idea. I know you're doing it in blueprint but it's pretty much the same thing.

        You would get your flipbook reference node (normally blue) and drag out a node from it and get the playbackposition in frame, and check to see if it's in its last frame, if so, transition.

        As far as your enum system. that's fine, looks great that you've kept it small. I use an enum system myself to switch between animations but my character has 8 different walking animations and 4 different attacking animations so you can imagine how crazy that is haha.
        WIP Wasabi Horizon: https://forums.unrealengine.com/show...wasabi+horizon

        Comment

        Working...
        X