Crate bevy_ichun

Crate bevy_ichun 

Source
Expand description

§Kinematic Character Controller for Bevy and Avian3D

Ichun provides a modular kinematic character controller (KCC) implementation for the Bevy engine using the Avian3D physics backend. It handles common gameplay features like character movement, jumping, running, and interaction with the environment.

§Features

  • Kinematic character controller with physics-based collision response
  • Modular design with separate movement and input systems
  • Support for slopes, moving platforms and static geometry
  • Configurable gravity, jump physics, and movement parameters
  • Optional input handling with customizable key bindings

§Module Structure

  • kcc: Core kinematic character controller functionality and physics
  • movement_events: Movement systems that generate actions to apply velocity from input
  • input: Input handling systems that generate movement events
  • actions: action systems execute movement actions to the character
  • system_sets: Bevy system sets for proper execution ordering

§Usage

Add the plugin to your Bevy app:

use bevy::prelude::*;
use ichun::IchunPlugin;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(IchunPlugin)
        .run();
}

Then add the KCC components to your character entity:

use bevy::prelude::*;
use bevy_ichun::{IchunPlugin, input::KccInputConfig, kcc::Kcc, movement::KccMovementConfig};

fn spawn_character(mut commands: Commands) {
   commands.spawn((
       Kcc::default(),
       KccMovementConfig::default(),
       KccInputConfig::default(),
       Mesh3d(meshes.add(Capsule3d::new(0.4, 1.0))),
       MeshMaterial3d(matl.add(Color::srgb(0.8, 0.7, 0.6))),
       Transform::from_xyz(0.0, 3.0, 0.0),
   ));
}

Modules§

actions
Character Actions System
kcc
Core Kinematic Character Controller
system_sets
System Sets for the Ichun Character Controller

Structs§

IchunPlugin