npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-3rd-person-character

v0.0.44

Published

A fast, minimal library designed to simplify the implementation of third-person interactive characters in 3D web scenes, using the latest ecosystem of 3D libraries for React.

Downloads

59

Readme

React 3rd Person Character

A fast, minimal library designed to simplify the implementation of third-person interactive characters in 3D web scenes, using the latest ecosystem of 3D libraries for React.


Docs

Official Documentation


Demo

Live CodeSandbox Demo
More examples will be added soon.


What This Library Solves

Managing compatibility across physics engines, three.js, and React-specific 3D libraries can be painful and time-consuming.

This library abstracts and integrates:

You do not need to install or manage these dependencies manually. The library re-exports all required modules.


📦 Packages Provided

This package exports:

  • All required 3D packages as FIBER, DREI, RAPIER, and THREE
  • A state machine-driven character provider with mobile and desktop control rendering
  • A modular setup that allows flexible 3D scene integration

⚠️ Important Notes

This library is non-opinionated. You are free to compose your scenes and behaviors however you like. That said, due to current technical limitations, one-shot animation delays must be specified manually — they cannot be extracted at runtime.

const character = new CharacterBuilder({ fps: 60 })
  .withAnimatedActionDelays({
    elevate: staticDelayTimeForelevate,
    action1: staticDelayTimeForaction1,
    action2: staticDelayTimeForaction2,
    action3: staticDelayTimeForaction3,
    action4: staticDelayTimeForaction4,
  })
  .build();

In future versions, we aim to provide an architectural solution to infer animation lengths automatically.

If you're unsure about your clip durations, you can inspect them manually:

action.getClip().duration; // returns a number in seconds

Refer to three.js documentation on AnimationAction for more details.

Usage Example

Entry Point and ActorProvider

import {
  ActorProvider,
  FIBER,
  StyledMobileControls,
  ExperienceWrapper,
  THREE,
} from "react-3rd-person-character";

import Experience from "./experience/index.tsx";
import { character } from "./experience/config.ts";
import { useDevice } from "use-device-react";

const gl: FIBER.GLProps = {
  outputColorSpace: THREE.SRGBColorSpace,
  toneMapping: THREE.ACESFilmicToneMapping,
  toneMappingExposure: 1.0,
};

export default function App() {
  const { isDesktop } = useDevice();
  return (
    <ActorProvider
      character={character}
      physics={{ debug: false }}
      renderControls
    >
      <FIBER.Canvas gl={gl} shadows>
        <ExperienceWrapper>
          <Experience />
        </ExperienceWrapper>
      </FIBER.Canvas>
      {!isDesktop && <StyledMobileControls />}
    </ActorProvider>
  );
}

Player implementaiton

import { DREI, Player, RAPIER, Scenario } from "react-3rd-person-character";

const Experience = () => {
  return (
    <>
      {/* any Three.js element or custom 3D components */}
      <RAPIER.RigidBody type="fixed" colliders="trimesh">
        <Scenario />
      </RAPIER.RigidBody>

      <Player>
        <RAPIER.CuboidCollider
          position={[0, 0.1, 0]}
          args={[0.2, 0.12, 0.2]}
        />
      </Player>
    </>
  );
};

export default Experience;

Contributing (Coming Soon)

This library is currently in an early stage of development. Once a more stable version is released, the GitHub repository will be made public and open to community contributions.

If you're interested in collaborating, feel free to reach out in advance or keep an eye out for the public release.

We plan to welcome:

  • Feature requests
  • Bug reports
  • Pull requests (for core, examples, or docs)
  • Architecture suggestions

Your input will help shape a more flexible and production-ready third-person character system for the modern React 3D ecosystem.# react-3rd-person-character