bevy_easy_portals
Easy-to-use portals for Bevy

Getting Started
First, add PortalPlugin to your app, then use the Portal component, et voila!
See the examples for more references.
use bevy::prelude::*;
use bevy_easy_portals::{Portal, PortalPlugin}
fn main() {
App::new()
.add_plugins((DefaultPlugins, PortalPlugin))
.add_systems(Startup, setup)
.run();
}
fn setup(
mut commands: Commands,
mut materials: ResMut<Assets<StandardMaterial>>,
mut meshes: ResMut<Assets<Mesh>>,
) {
let primary_camera = commands
.spawn((Camera3d::default(), Transform::from_xyz(0.0, 0.0, 10.0)))
.id();
commands.spawn((
Mesh3d(meshes.add(Cuboid::default())),
MeshMaterial3d(materials.add(Color::WHITE)),
Transform::from_xyz(10.0, 0.0, 0.0),
));
let target = commands.spawn(Transform::from_xyz(10.0, 0.0, 10.0)).id();
let portal_transform = Transform::default();
commands.spawn((
Mesh3d(meshes.add(Rectangle::default())),
portal_transform,
Portal::new(primary_camera, target),
));
}
Compatibility
bevy_easy_portals |
bevy |
0.3 |
0.15 |
0.1..0.2 |
0.14 |
Features
| Feature |
Description |
gizmos |
Use gizmos for the portal's aabb and camera transform |
Contributing
Feel free to open a PR!
If possible, please try to keep it minimal and scoped.
Alternatives