How do I play audio file for each animation frame?

0 favourites
  • 3 posts
From the Asset Store
Selection frame like in RTS games, works both on mobile and desktop devices.
  • I have an animation with about 100 frames and want to play audio files(also about 100 matches each frame) when clicked.

    I've tried setting the audio file name to Flashcards.AnimationFrameCount, which is the current animation frame.

    and changing the names of all audio files to the matching frame number.

    but The error says the parameter does not take number.

    How can I make each audio files to play at a matching frame?

  • If your audio files have just numbers for names (1, 2, 3 etc.), then use str() expression:

    Audio Play By Name str(Sprite.AnimationFrame)
    

    Also, AnimationFrameCount is the quantity of frames. You need AnimationFrame.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If your audio files have just numbers for names (1, 2, 3 etc.), then use str() expression:

    > Audio Play By Name str(Sprite.AnimationFrame)
    

    Also, AnimationFrameCount is the quantity of frames. You need AnimationFrame.

    Thank you so much again.

    Your tip solved my problem and saved a lot of my time.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)