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

Turning 1 Static Mascot Image Into 5 Interactive States (Idle, Happy, Wave, Loading, Launch)

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: Turning 1 Static Mascot Image Into 5 Interactive States (Idle, Happy, Wave, Loading, Launch), with Charmotion demo characters

You turn one static mascot PNG into five interactive app states by sending a single number, mood, from your app code to one Rive file. Idle, happy, wave and loading share one character state machine, and a separate launch state machine plays the intro once before idle takes over.

Key takeaways

  • One PNG becomes five states: idle, happy, wave, loading and a launch intro.
  • The mood number is the only input your app needs for four of the five states.
  • Launch sits in its own state machine and plays once when the app starts.
  • Test every mood value and a cold start before each 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.

What are the five interactive app states?

Learning how to turn one static mascot PNG into 5 interactive app states starts with agreeing on the list. Five states cover most mascot work in an app: a resting character, a success moment, a greeting, a waiting state and an intro when the app opens. Each one maps to a single value, so your code never needs a second image or video file.

StateWhat it doesLengthMood valueTypical app moment
IdleBreathing and blinking loop, always included4.0 s loop0Default on every screen
HappyBright reaction with sparkles on by default1.6 s1Task complete, success
WaveFriendly greeting3.0 s2Welcome, first open of a screen
LoadingWorking or waiting motion1.2 s5Network request in progress
LaunchIntro that plays once, then holds idle2.6 sNot a mood, separate launch machineApp start or splash

Idle is the resting state the character returns to after every other mood. Launch is the one state you cannot reach from the mood number, because it lives in its own state machine. Keep that in mind when you plan the code below.

Which mascot image works for an interactive state set?

The image decides most of the result. The engine rigs the drawing you upload, so it needs one finished character, coloured, facing the viewer, with visible eyes and a visible mouth. The check runs first: sketches, photos, groups of characters and busy scenes are refused before anything is generated, and a refused image is not charged.

  • Use one character only, with the body fully in frame and no cropped feet, ears or antennae.
  • Export a PNG, JPEG or WebP. A transparent background keeps the edges clean on coloured app screens.
  • Keep the starting pose neutral. A character already waving or leaning will look odd in the idle loop.
  • Finish the colours and outline before upload, so every state uses the final brand palette.

If the mascot is 3D, plush, realistic or very detailed, the animation can look weaker. In that case you can first convert the image to a cleaner illustration style (1 credit) and pick which version to animate. The steps for a plain PNG are in PNG to Rive animation, and the broader image rules are in how to animate a logo from a PNG.

Which animations should you pick for idle, happy, wave and loading?

Charmotion gives a character up to 11 animations, and you pick them from ten. Idle is always included for free, and launch, happy, wave and loading are preselected. Each picked animation costs one credit, so the four preselected ones cost four credits and complete the five-state set in this guide. Plan details are on the pricing page.

The export is one Rive (.riv) file with up to three state machines. CharacterViewModelMachine holds a number property named mood, CharacterStateMachine has a number input also named mood, and LaunchStateMachine appears only when launch was picked. Moods blend into each other, so a switch from idle to wave does not cut hard.

You can add more animations later. Only the new ones use credits, so you can start with these five and add thinking, listening or sleeping when the product needs them. The how it works page lists the animations and formats available on each plan.

Why does one number input work better than separate triggers?

Rive state machines accept three kinds of input: number (a float value), boolean (true or false) and trigger (a one-shot signal). Rive's help pages say a state machine changes state when you set boolean or number inputs, or fire trigger inputs. Triggers suit one-off events such as a tap or a reset, while a number holds a state that the app can read and change at any time.

Here one number chooses the state. Idle is 0, happy is 1, wave is 2, loading is 5, and the other moods use 3, 4, 6, 7, 8 and 9. The numbers are fixed, so the app and the file agree without naming every state in code. Characters have no one-shot triggers such as success, error, yes, no, enter or exit, so show a success with happy and an error with sad.

Because the mood is a number, a state change is a single assignment. The character blends from its current mood into the new one, and setting 0 brings it back to idle.

How do you set the mood value from app code?

Your code reads the state machine's inputs, finds the one named mood and writes a number to it. In the Rive web runtime, you list a state machine's inputs with stateMachineInputs and the state machine name, then read and set a number input through its value property. Android and Flutter follow the same idea with their own calls, for example Flutter creates a state machine controller from the artboard and state machine name, then reads controller.stateMachine.inputs.

const inputs = rive.stateMachineInputs('CharacterStateMachine');
const mood = inputs.find((input) => input.name === 'mood');

function showMood(value) {
  if (mood) mood.value = value;
}

showMood(5); // loading while a request runs
showMood(1); // happy when it succeeds
showMood(0); // back to idle

Method and package names change between runtime releases, so check the runtime page for your platform before you copy any call. A React hook named useStateMachineInput takes the Rive instance, the state machine name and the input name, and returns the input so it can be set. Whatever the platform, keep one function that maps app events to mood numbers, so every screen uses the same values.

How do you play the launch once and then hand over to idle?

The launch is a separate state machine, so start it when the app opens and leave the mood number alone until it finishes. The launch runs for 2.6 seconds, plays once and ends on idle. After that, your mood values take over.

  • Load the launch machine when the splash screen appears.
  • Store a flag such as hasLaunched in local storage or user defaults, and skip the launch on later opens if the design calls for it.
  • Do not set a mood during the launch unless you want the intro cut short. Set the first mood after it ends.

Timing matters for the other states too. Loading is 1.2 seconds long, so keep it on screen for as long as the request runs rather than assuming one pass will finish it. Happy runs 1.6 seconds, so give it time to be read before you return to 0. The wider loading rules are in how to add a loading animation, and the state logic is in mascot animation states.

How do you test all five states before a release?

Test the file before the code. Confirm that the mood input and the launch machine are present, then check the list of inputs in the Rive file inspector. After that, test inside the app:

  1. Set each mood value from 0 to 9 once and confirm the expected animation plays.
  2. Switch quickly between two moods to check that the blend does not stall or jump.
  3. Start the app cold and confirm the launch plays once, then idle holds.
  4. Turn off the accents flag if sparkles or thinking dots clash with the screen, since accents are on by default.
  5. Check each state at the smallest and largest device sizes, plus dark mode.

Plan the mood map before you build. The mascot state planner helps you list which app event maps to which number.

How to turn one static mascot PNG into 5 interactive app states

  1. Prepare one finished character image. Use one coloured character facing the viewer with visible eyes and mouth, as a PNG, JPEG or WebP. Sketches, photos, groups and busy scenes are refused before any charge.
  2. Pick the five states. Keep idle, which is always included, and pick happy, wave and loading, with launch preselected. Each picked animation costs one credit.
  3. Export the Rive file. Download the .riv file and confirm it has CharacterStateMachine with a number input named mood, and LaunchStateMachine when launch was picked.
  4. Map app events to mood numbers. Write one function that maps events to values: idle 0, happy 1, wave 2, loading 5. Show success with happy and errors with sad.
  5. Play the launch once on app start. Load the launch state machine on the splash screen, let it run its 2.6 seconds, then set your first mood.
  6. Test all states before release. Set every value from 0 to 9, switch quickly between moods, cold-start the app and check accents and sizes.

Frequently asked questions

Can I upload a JPEG or WebP instead of a PNG?

Yes. The accepted formats are PNG, JPEG and WebP. A PNG with a transparent background is usually the cleanest choice for a mascot that sits over coloured app screens, since its edges blend with whatever is behind it.

What if my app sends a mood number that is not in the list?

Only the numbers 0 to 9 are defined as moods, and the table in this guide covers the five states you need. The behaviour of other values is not documented, so keep your code within that set and guard against bad input.

Can the same .riv file run in Flutter and React Native as well?

Rive's runtimes are open source and play any .riv file, and official runtimes exist for web, Android, Flutter, React Native and Apple platforms. Each platform calls inputs with its own method names, so check that runtime's page for the current calls.

Can I add more states after the first release?

Yes. Thinking, sad, listening, talking, sleeping and attention each have a mood number and can be added to the same character later, paying only for what is new.

Sources

Related guides