Menu

Behavior

How the pet decides what to do, and how to tune it.

Modes

The pet ticks 8 times a second and is always in one of 3 modes, checked in this order.

ModeWhenDefaultDescription
hovercursor near—Stops and plays hoverAction. The bubble shows.
idleat target—Rests and cycles idleActions.
walkingotherwise—Moves toward the target with a movementAction.

Tuning

Pass any of these in behavior. Omit the rest.

<WebPet
  animal="turtle"
  color="orange"
  behavior={{
    hoverAction: "with_ball",
    idlePauseMs: { min: 3000, max: 6000 },
    movementActions: [{ name: "walk", speedMultiplier: 1 }],
  }}
/>
PropTypeDefaultDescription
hoverActionstring"swipe"Action played while the cursor is near.
hoverDistnumber50Radius in px that counts as near.
idleDistnumber48Distance from target at which the pet stops.
idlePauseMs{ min, max }{ 1500, 2200 }Rest between walks.
idleActionsIdleAction[]idle, swipePoses cycled while resting.
movementActionsMovementAction[]walk, walk_fast, runOne is picked per walk.
actionsstring[]from manifestGIFs the animal has. Others fall back.