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 physicsmovement_events: Movement systems that generate actions to apply velocity from inputinput: Input handling systems that generate movement eventsactions: action systems execute movement actions to the charactersystem_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