A powerful Unity package for creating and managing ragdoll physics in your games. This package provides an easy-to-use system for switching between animated and ragdoll states, with support for both humanoid and generic character rigs.
- 🎭 Dual State System: Seamlessly switch between animated and ragdoll physics
- 🤖 Humanoid Support: Pre-configured bone mappings for humanoid characters
- 🔧 Generic Support: Flexible system for custom character rigs
- ⚡ Performance Optimized: Efficient physics calculations and state management
- 🎨 Editor Tools: Built-in sandbox for testing ragdoll configurations
- 📦 Preset System: Save and reuse ragdoll configurations
- 🔌 Plugin Architecture: Extensible system for custom behaviors
- 📊 Real-time Testing: Interactive sandbox environment
- Open your Unity project (2022.3 or later)
- Go to
Window>Package Manager - Click the
+button and selectAdd package from git URL... - Enter:
https://github.com/Depra-Inc/Ragdoll.git - Click
Add
Add this line to your Packages/manifest.json:
{
"dependencies": {
"com.depra.ragdoll": "https://github.com/Depra-Inc/Ragdoll.git"
}
}using Depra.Ragdoll;
// Add RagdollBody component to your character
var ragdollBody = character.AddComponent<RagdollBody>();
// Enable ragdoll physics
ragdollBody.Enable();
// Disable ragdoll physics (return to animation)
ragdollBody.Disable();The package includes a built-in sandbox for testing ragdoll configurations:
- Select a
HumanoidArmaturePresetin your project - Right-click and select "Open Ragdoll Sandbox"
- Choose a prefab to test
- Use mouse to apply forces to the ragdoll
- Press
Rto reset,EscorQto quit
- Left Mouse Button: Charge and apply force
- R: Reset ragdoll to initial state
- Esc/Q: Exit sandbox
Each bone can be configured with:
- Mass: Physics mass of the bone
- Drag: Air resistance
- Angular Drag: Rotational resistance
- Joint Limits: Constraint limits for connected bones
- Collider Settings: Shape and material properties
- Create a new
HumanoidArmaturePresetasset - Configure physics parameters for each bone type
- Assign the preset to your
HumanoidArmature - Use
ApplyPreset()to load settings - Use
SavePreset()to save current configuration
The package follows a modular architecture:
Depra.Ragdoll/
├── Body/ # Core ragdoll components
├── Humanoid/ # Humanoid-specific implementations
├── Generic/ # Generic character support
├── Plugins/ # Extensible plugin system
├── Sandbox/ # Testing and debugging tools
└── Editor/ # Unity editor integration
We welcome contributions! Please see our Contributing Guidelines for details.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
- Unity Technologies for the amazing physics system
- The open-source community for inspiration and feedback
- Issues: GitHub Issues
- Email: n.melnikov@depra.org
- Website: Depra Inc.
Made with ❤️ by Depra Inc.