https://github.com/bytemeadow/godot-bevy
A library to use Bevy for Godot projects
https://github.com/bytemeadow/godot-bevy
bevy gamedev godot
Last synced: 3 months ago
JSON representation
A library to use Bevy for Godot projects
- Host: GitHub
- URL: https://github.com/bytemeadow/godot-bevy
- Owner: bytemeadow
- License: apache-2.0
- Created: 2025-05-06T15:45:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-19T20:56:40.000Z (12 months ago)
- Last Synced: 2025-06-19T22:16:38.940Z (12 months ago)
- Topics: bevy, gamedev, godot
- Language: Rust
- Homepage:
- Size: 9.74 MB
- Stars: 134
- Watchers: 5
- Forks: 11
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# godot-bevy
[](https://discord.gg/gqkeBsH93H)
[](https://crates.io/crates/godot-bevy)
[](https://docs.rs/godot-bevy/latest/godot_bevy/)
[](https://bytemeadow.github.io/godot-bevy-book)
[](https://github.com/bytemeadow/godot-bevy/actions/workflows/ci.yml)
[](https://releases.rs/docs/1.88.0)

**godot-bevy** brings Bevy's powerful ECS to Godot, allowing you to write high-performance game logic in Rust while leveraging Godot's excellent editor and rendering capabilities.
---
_Special thanks to [Blaze](https://runblaze.dev) for their support of this project. They provide high-performance Linux (AMD64 & ARM64) and Apple Silicon macOS runners for GitHub Actions, greatly reducing our automated build times._
## 📚 Documentation
**[Read the godot-bevy Book →](https://bytemeadow.github.io/godot-bevy-book)**
The book covers everything you need to know:
- Installation and setup
- Core concepts and architecture
- **Plugin system** (opt-in features)
- Transform system and physics
- Input handling
- Examples and best practices
## 🚀 Quick Start
Add to your `Cargo.toml`:
```toml
[dependencies]
godot-bevy = "0.11.0" # Latest with opt-in plugin system
bevy = { version = "0.18", default-features = false }
godot = "0.4"
```
Basic example:
```rust
use bevy::prelude::*;
use godot::prelude::*;
use godot_bevy::prelude::*;
#[bevy_app]
fn build_app(app: &mut App) {
// Add the features you need (v0.8+ opt-in plugin system)
app.add_plugins(GodotTransformSyncPlugin::default()) // Transform sync
.add_plugins(GodotAudioPlugin); // Audio system
// Print to the Godot console
godot_print!("Hello from Godot-Bevy!");
// Add your game systems
app.add_systems(Update, position_system);
}
// A system is a normal Rust function. This system moves all Node2Ds to the right, such as Sprite2Ds.
//
// The `transform` parameter is a Bevy `Query` that matches all `Transform` components.
// `Transform` is a Godot-Bevy-provided component that matches all Node2Ds in the scene.
// (https://docs.rs/godot-bevy/latest/godot_bevy/plugins/core/transforms/struct.Transform.html)
//
// For more information on Bevy Components, Systems, and Queries, see:
// (https://bevy.org/learn/quick-start/getting-started/ecs/).
fn position_system(mut transform: Query<&mut Transform>) {
// For single matches, you can use `single_mut()` instead:
// `if let Ok(mut transform) = transform.single_mut() {`
for mut transform in transform.iter_mut() {
// Move the node to the right.
transform.translation.x += 1.0;
}
}
```
## 🔧 Plugin System (v0.8+)
godot-bevy now uses an **opt-in plugin system** for maximum efficiency:
```rust
// Minimal setup - only core features
#[bevy_app]
fn build_app(app: &mut App) {
// Scene tree and assets included by default
app.add_systems(Update, my_systems);
}
// Add specific features as needed
#[bevy_app]
fn build_app(app: &mut App) {
app.add_plugins(GodotTransformSyncPlugin::default()) // Transform sync
.add_plugins(GodotAudioPlugin) // Audio system
.add_plugins(BevyInputBridgePlugin); // Input handling
}
// Or everything at once (like v0.7.x)
#[bevy_app]
fn build_app(app: &mut App) {
app.add_plugins(GodotDefaultPlugins);
}
```
**Benefits**: Smaller binaries, better performance, clearer dependencies. See the [Plugin System Guide](https://bytemeadow.github.io/godot-bevy-book?page=getting-started/plugins.html) for details.
## 🎮 Examples
Check out the [examples](./examples) directory:
- **[2D Platformer](./examples/platformer-2d)** - Physics-based platformer
- **[Dodge the Creeps](./examples/dodge-the-creeps-2d)** - Classic arcade game
- **[Simple Movement](./examples/simple-node2d-movement)** - Basic transform usage
## ✨ Inspiration and Acknowledgements
This library was inspired by and originally built upon the work of [bevy_godot](https://github.com/rand0m-cloud/bevy_godot), which provided similar functionality for Godot 3. `godot-bevy` extends this concept to support Godot 4 and Bevy 0.16. It has now diverged quite a bit.
## ⊹ Version Compatibility Matrix
| `godot-bevy` | Bevy | Godot-Rust | Godot |
|--------------|------|------------|-------|
| 0.11.x | 0.18 | 0.4 | 4.6.x |
| 0.10.x | 0.17 | 0.4 | 4.5.x |
| 0.9.2 | 0.16 | 0.4 | 4.5.x |
| 0.9.x | 0.16 | 0.3 | 4.4.x |
| 0.8.x | 0.16 | 0.3 | 4.4.x |
| 0.7.x | 0.16 | 0.3 | 4.4.x |
## 🦀 MSRV
The minimum supported Rust version is 1.88.0.
The MSRV is the minimum Rust version that can be used to compile each crate.
## 📕 License
godot-bevy is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See [LICENSE-APACHE](./LICENSE-APACHE) and [LICENSE-MIT](./LICENSE-MIT) for details. Opening a pull
request is assumed to signal agreement with these licensing terms.
## 🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
### Developing environment
If you're on MacOS or Linux, you can quickly get started developing against this
package using https://devenv.sh/, and (optionally) https://direnv.net/. Once
they are setup/installed, you can leverage `devenv shell` in the root of this
package to setup a development environment that includes all system
dependencies, rust, godot, and other developer tools used in this package. Check
out [devenv.nix](./devenv.nix) for details. You can, of course, skip this and
use system-installed tooling of your own; but keep in mind that your system
dependency versions (like Godot) may drift from what other contributors or our
CI tooling use.