GitPedia

Bevy tnua

A floating character controller for Bevy

From idanarye·Updated June 17, 2026·View on GitHub·

Tnua ("motion" in Hebrew) is a floating character controller, which means that instead of constantly touching the ground the character floats above it, which makes many aspects of the motion control simpler. The project is written primarily in Rust, distributed under the Apache License 2.0 license, first published in 2022. Key topics include: bevy-plugin, character-controller, locomotion, rapier2d, rapier3d.

Latest release: avian-v0.11.1Avian Integration 0.11.1 - 2026-04-03
April 2, 2026View Changelog →

Build Status
Latest Version
Rust Documentation
Rust Documentation

Tnua - A Character Controller for Bevy.

Tnua ("motion" in Hebrew) is a floating character controller, which means that instead of constantly touching the ground the character floats above it, which makes many aspects of the motion control simpler.

Tnua can use Rapier or Avian (formerly XPBD), and supports both the 2D and 3D versions of both with integration crates:

Note that:

  • Both integration crate (bevy-tnua-<physics-backend>) and the main bevy-tnua crate are required, and that the main plugin from both crates should be added.
  • If you use a physics backend with double precision (like Avian with the f64 flag), you need to add the f64 flag to all the Tnua crates. This applies to double precision data that gets defined by the physics backend - Bevy itself will still use single precision, and this is the precision the position and rotation will use.

Features

  • Supports both 2D and 3D versions of Rapier and Avian
  • Running
  • Jumping
  • Crouching
  • Variable height jumping
  • Coyote time
  • Jump buffer
  • Running up/down slopes/stairs
  • Tilt correction
  • Moving platforms
  • Rotating platforms
  • Animation helpers (not the animation itself, but Tnua has facilities that help deciding which animation to play)
  • Jump/fall through platforms
  • Air actions
  • Obstacle actions:
    • Wall sliding (and jumping)
    • Climbing

Demos:

The basis and actions in the demos can be tweaked with a GUI. They are initialized to the Default::default() provided in Tnua, with the following exceptions:

  • TnuaBuiltinWalkConfig::float_height is set to 2.0 even though it defaults to 0.0. User code should always set the float height based on the model's geometrics.
  • TnuaBuiltinWalkConfig::max_slope is set to $\frac{\pi}{4}$ even though it defaults to $\frac{\pi}{2}$ (which disables the slipping behavior, since this is the slope angle of a wall)
  • TnuaBuiltinJumpConfig::height is set to 4.0 even though it defaults to 0.0. User code should always set the jump height based on the game's requirements (a jump action of zero height is useless)
  • TnuaBuiltinCrouchConfig::float_offset is set to -0.9 even though it defaults to 0.0. Just like float_height, this value should always be set by user code based on the model's geometric.
  • TnuaBuiltinDashConfig::horizontal_distance is set to 10.0 even though it defaults to 1.0.
  • TnuaBuiltinDashConfig::vertical_distance is set to 0.0 even though it defaults to 1.0. This means that the vertical component added to it when Shift is pressed in the demo gets zeroed (and the character does not lift to air while dashing) unless that value is changed in the settings UI.

Running the Demos Locally

sh
$ cargo run --bin <demo-name> --features <physics-backend>

Where <demo-name> is the name of the demo and <physics-backend> is either rapier2d, rapier3d, avian2d or avian3d. Make sure to match the dimensionality of the backend (2D or 3D) to that of the demo. For example, to run the 3D platformer with Avian, use this:

sh
$ cargo run --bin platformer_3d --features avian3d

Interesting Parts of the Demo Code

(NOTE: the examples are simpler than the demos, so if there is an example that shows something it'll be easier to read that)

Versions

Tnua is broken into different crates that update separately, so this is broken into multiple tables. The version of bevy-tnua-physics-integration-layer must be the same for both the main bevy-tnua crate and the integration crates.

Main

bevybevy-tnua-physics-integration-layerbevy-tnua
0.180.120.29 - 0.31
0.170.110.27, 0.28
0.170.100.26
0.160.90.25
0.160.80.24
0.150.70.23
0.150.60.22
0.150.50.21
0.140.40.19, 0.20
0.130.30.16 - 0.18
0.130.20.15
0.120.10.13, 0.14

Rapier integration

bevybevy-tnua-physics-integration-layerbevy-tnua-rapierbevy_rapier
0.170.110.150.32
0.160.90.140.31
0.160.90.130.30
0.160.80.120.30
0.150.70.110.29
0.150.60.100.29
0.150.50.8, 0.90.28
0.140.40.70.27
0.130.30.60.26
0.130.30.4, 0.50.25
0.130.20.30.25
0.120.10.20.24
0.120.10.10.23

Avian integration

bevybevy-tnua-physics-integration-layerbevy-tnua-avianavian
0.180.120.110.6
0.180.120.100.5
0.170.110.90.4
0.170.100.7, 0.80.4
0.160.90.60.3
0.160.80.50.3
0.150.70.40.2
0.150.60.30.2
0.150.50.20.2
0.140.40.10.1

XPBD integration

Will not receive any more updates since the bevy_xpbd project has been rebranded as "Avian".

bevybevy-tnua-physics-integration-layerbevy-tnua-xpbdbevy_xpbd
0.140.40.50.5
0.130.30.3, 0.40.4
0.130.20.20.4
0.120.10.10.3

Pre-split

bevybevy-tnuabevy_rapier
0.120.120.23
0.110.8 - 0.110.22
0.100.1 - 0.70.21

Reference Material

The following were used for coding the math and physics of Tnua:

Alternatives

  • bevy_mod_wanderlust - the original inspiration for this mod, and where I got the floating capsule video from. I ended up creating my own plugin because bevy_mod_wanderlust does not support 2D.
  • Rapier itself has a character controller. It's not a floating character controller, but it's integrated with the physics engine itself and uses that privilege to work out some of the problems the floating model is used to address.
  • Bevy Ahoy! - a kinematic character controller for Avian 3D.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any
additional terms or conditions.

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from idanarye/bevy-tnua via the GitHub API.Last fetched: 6/18/2026