Skip to content
Limited timeStarter is now $9 a month instead of $20.See plans
charmotion

How to Build Achievement Badge & Level-Up Celebration Mascot Animations

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: How to Build Achievement Badge & Level-Up Celebration Mascot Animations, with Charmotion demo characters

Use one animated mascot state per moment in an achievement or level-up modal: happy (mood 1) when a badge is earned, attention (mood 9) when the player must tap to claim, and idle (mood 0) when the modal closes. Your app sets the mood number on a Rive state machine input and resets it to idle when the celebration ends.

Key takeaways

  • Give each reward event one mascot state: happy for earned badges and level ups, attention for claims that need a tap, sad for failed claims.
  • Mood numbers are plain numbers on a Rive state machine input, so keep the mapping in one constant and one function.
  • Hold each celebration for its clip length, then return to idle, and reset immediately if the modal closes early.
  • Respect reduced motion by turning off the modal transition and showing a still poster of the mascot instead of its movement.
  • Test back-to-back events, mid-clip dismissals and missing input names before release.

Already have a character or logo? See examples in real app screens: splash, onboarding, loading and empty-state screens, with the animation that plays in each.

Which achievement moments need a mascot reaction?

This guide covers how to make an animated mascot for achievement and level-up modals without adding noise to the rest of the app. A modal is a good place for a character because the player is already looking at a reward. Outside that moment, a mascot that moves on every screen competes with the content.

Four moments cover most reward modals:

  • Badge earned. The reward appears and the player is invited to see it. Use happy.
  • Level up. The player reached a new level. Use happy, and add wave if the modal lists new perks.
  • Claim required. The player must tap to collect a reward. Use attention so the character points the eye at the button.
  • Claim failed. The reward could not be granted. Use sad, and put the explanation in the modal text so the meaning does not depend on the character.

When the modal closes, the mascot goes back to idle. Idle is the breathing and blinking loop that comes free with every character, so the mascot never freezes between celebrations.

Streak rewards follow a similar pattern with more states. See how to build a Duolingo-style streak celebration for that case.

Which mood numbers should each achievement event use?

Rive state machine inputs carry plain numbers, so the mood can be stored, logged and tested like any other value. The mood numbers used here are idle 0, happy 1, wave 2, thinking 3, sad 4, loading 5, listening 6, talking 7, sleeping 8 and attention 9. Moods blend into each other, so a change from idle to happy eases rather than cutting.

EventMoodNotes
Badge earnedhappy (1)Sparkles show by default
Level uphappy (1), then wave (2)Start wave after the happy clip ends
Claim requiredattention (9)The attention accent shows a exclamation mark by default
Claim failedsad (4)Explain the failure in the modal text
Modal closedidle (0)Return here as soon as the modal closes

Keep these numbers in one constant and one function, so the mapping lives in one place:

const MOOD = { idle: 0, happy: 1, wave: 2, sad: 4, attention: 9 };
function moodForEvent(event) {
  if (event.type === 'badge_earned' || event.type === 'level_up') { return MOOD.happy; }
  if (event.type === 'claim_required') { return MOOD.attention; }
  if (event.type === 'claim_failed') { return MOOD.sad; }
  return MOOD.idle;
}

The function takes an event your app already emits, such as a score change or a server response. The character never sees raw game data, only a mood number.

How do you set the mood from a modal in code?

The character file contains CharacterStateMachine with a number input named mood, plus CharacterViewModelMachine with a number property of the same name. Either can be driven, depending on the runtime you use. On the web, the state machine input is the most direct route.

The web runtime lists a state machine's inputs by state machine name, and a number input exposes a value property you can set. Rive's state machine help describes this pattern, and the code below follows it:

// rive is the Rive instance your page created for the character file
const moodInput = rive.stateMachineInputs('CharacterStateMachine').find(function (input) { return input.name === 'mood'; });
function setMood(value) {
  if (moodInput) { moodInput.value = value; }
}

In Flutter, you create a state machine controller from the artboard and the state machine name, then read its inputs from controller.stateMachine.inputs. On Android, the runtime help lists separate setter methods for number, boolean and trigger inputs, called through the view. Character files have no trigger inputs, so the number setter is the one you need.

The guard in the web example does nothing if the name is wrong, so add a test that asserts the input is found at startup. For more on inputs, see Rive state machine inputs, triggers and moods.

How long should a celebration run before the mascot returns to idle?

Timing starts from the clip lengths. The published lengths are: happy 1.6 seconds, attention 1.4 seconds, wave 3.0 seconds, sad 3.0 seconds, and idle is a 4.0 second loop. Use them as the base, then give the modal its own pace.

AnimationLengthGood use in a modal
happy1.6 sBadge earned and level up
attention1.4 sClaim prompt
wave3.0 sPerks list after a level up
sad3.0 sFailed claim
idle4.0 s loopModal closed

Start the reset timer when the mood changes, and cancel it if the modal closes early or a second event arrives. This code does both:

let celebrationTimer = null;
function celebrate(mood, holdMs) {
  clearTimeout(celebrationTimer);
  setMood(mood);
  celebrationTimer = setTimeout(function () { setMood(MOOD.idle); }, holdMs);
}
function onModalClose() {
  clearTimeout(celebrationTimer);
  setMood(MOOD.idle);
}

Call it as celebrate(MOOD.happy, 1600). Do not hold the reward text or the claim button until the mascot finishes. The player should be able to tap at any point. Character files have no one-shot triggers, so the return to idle is always code you write, which is why the close handler resets the mood even when the timer has not fired.

Should a level-up celebration move when the user prefers less motion?

Respect the system setting. Modals often animate in with a scale or fade, and the mascot adds its own motion on top. Turn off the modal transition for users who ask for less motion, and give the mascot a quieter path too.

@media (prefers-reduced-motion: reduce) {
  .reward-modal {
    transition: none;
  }
}

Each animation comes with a transparent poster. With reduced motion on, show the happy poster as a still image, which keeps the expression without the movement. Sparkles belong to the happy accent, and the accents boolean hides them, so you can turn them off in that mode.

Do not rely on the character alone to say what happened. The modal heading and reward text carry the meaning. For more patterns, see accessible animation and reduced motion. SwiftUI apps can follow Reduce Motion in SwiftUI and UIKit.

How do you make the character file for these moods?

Start with one finished character image. Charmotion needs one coloured character facing the viewer with visible eyes and mouth. Sketches, photos, groups and busy scenes are refused before anything is charged. A modal needs only a few moods, so choose a small set rather than all ten.

  • Pick happy and attention, and add wave or sad if your modals use them. Launch, happy, wave and loading are preselected, so untick the ones you do not need.
  • Idle is added for free. Each other animation costs 1 credit, and you can add more later, paying only for the new ones.
  • Export the Rive (.riv) file. It contains CharacterViewModelMachine with the number property mood, CharacterStateMachine with the number input mood, a README and an AI_README for coding assistants.
  • Paste-ready web, React and SwiftUI code is included. The modal logic above is what you add on top of it.

Charmotion does not put triggers on characters, so a success is shown with happy and an error with sad, as in the mood map. Pricing and credit allowances are on the pricing page.

Charmotion makes the character file from one image, and the modal logic stays in your app.

What should you test before a celebration ships?

  • Fire two events in a row, such as a level up followed by a badge, and confirm the second celebration is not cut off by the first timer.
  • Dismiss the modal in the middle of a clip, then reopen it. The mascot should start from idle.
  • Assert that the mood input exists at startup. A wrong input name fails quietly, so a test is the only reliable check.
  • Test on light and dark backgrounds, since the character is transparent and must stay readable on both.
  • Turn on reduced motion and confirm the reward text still explains the result.
  • Check the mood numbers against your event list with the mascot state planner.

For the wider set of states, including loading and error screens, see mascot animation states. For the broader build, read the guide to making an animated mascot for your app.

How to make an animated mascot for achievement and level-up modals

  1. List the reward events. List the reward events in your app, such as a badge earned, a level up, a claim that needs a tap and a failed claim.
  2. Map each event to a mood. Assign mood numbers to each event: happy 1 for earned badges and level ups, attention 9 for claims, sad 4 for failures, and idle 0 for the closed state.
  3. Create the character file. Upload one character image to Charmotion, pick happy, attention and any other moods you need, then export the .riv file.
  4. Load the file and find the input. Add the .riv file to your app and read the CharacterStateMachine input named mood, or the mood property on CharacterViewModelMachine.
  5. Set and reset the mood. Set the mood when the modal opens, hold it for the clip length, and set idle when the modal closes or a new event arrives.
  6. Test before release. Fire back-to-back events, dismiss the modal mid-clip, confirm the input is found, and check the celebration with reduced motion on.

Frequently asked questions

Can a level-up modal play a sound with the mascot?

The Charmotion file holds animation and state inputs, not audio. Play any sound from your app's code, only after the user has turned sound on, and keep the reward text on screen so the meaning does not depend on it. Test the cue with your own users before adding one to every reward.

Do I need a paid Rive plan to ship the mascot file?

It depends on the plan. On Rive's Free plan, exported files play a Rive splash screen, and paid plans export without it. Check the current terms before release, since plans change. Our Rive free plan and pricing guide covers the options as of December 2026.

Should the mascot react to every point or XP gain?

No. Point and XP changes are frequent, and a reaction for each one trains players to ignore the mascot. Reserve the celebration for milestones the player can see in the modal, and keep ordinary gains in the regular interface.

Can one character serve achievement modals and an empty state?

Yes. One character file can carry idle, happy, attention and sad, so the same mascot can appear in a reward modal and an empty state. Choose only the moods each screen uses, because each added animation costs one credit.

Sources

Related guides