-
Notifications
You must be signed in to change notification settings - Fork 44
ColliderBundle #283
Comments
There is none... Yet. Currently you pick the components you need, and only that. We could potentially add bundle types. Though, I am not yet sure what to provide exactly. Basically, only two components are required: |
Hey. I'm using bevy_ecs_ldtk which recommends using |
|
As I just said above, yes we could potentially add a "bundle" type. But I am still not so sure about which components it should contain. Should it be I gess these lines from commands
.spawn()
.insert(CollisionShape::Cuboid {
half_extends: Vec3::new(
(wall_rect.right as f32 - wall_rect.left as f32 + 1.)
* grid_size as f32
/ 2.,
(wall_rect.top as f32 - wall_rect.bottom as f32 + 1.)
* grid_size as f32
/ 2.,
0.,
),
border_radius: None,
})
.insert(RigidBody::Static) to that: commands
.spawn_bundle(ColliderBundle {
body: RigidBody::Static,
collider: CollisionShape::Cuboid {
half_extends: Vec3::new(
(wall_rect.right as f32 - wall_rect.left as f32 + 1.)
* grid_size as f32
/ 2.,
(wall_rect.top as f32 - wall_rect.bottom as f32 + 1.)
* grid_size as f32
/ 2.,
0.,
),
border_radius: None,
}
})) It doesn't change much... And in practice, such a bundle may not be used so often, given that more complex usage would often need to spawn the collision shape in a child entity. |
As I said, the onli components for that bundle would be various colliders,
no rigidbody, just various colliders
|
That doesn't make sense to me. I assume that by "collider" you mean You cannot insert multiple |
Well then how to add collision to a tilemap
|
Insert a Maybe read the example of I think the documentation is pretty clear. If you think it isn't, please suggest a concrete improvement. When it comes to adding a bundle type, if you want to continue the discussion, please be more precise about what components the bundle should contain in your opinion. Maybe share here your user-code version of that bundle. And explain why that would be an improvement over the current situation. |
I'm making a tilemap and that would be really useful, where is it, or something similar?
The text was updated successfully, but these errors were encountered: