Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump/stuck when walking on aligned colliders #640

Open
SakiiCode opened this issue Jan 23, 2025 · 1 comment
Open

Bump/stuck when walking on aligned colliders #640

SakiiCode opened this issue Jan 23, 2025 · 1 comment

Comments

@SakiiCode
Copy link

I am prototyping a voxel game and walking on perfectly aligned cube colliders does not work properly

The capsule collider has a bump and the cylinder collider can't even go between blocks

Video (capsule collider)

Image

You can reproduce it with the stock dynamic_character_3d.rs by adding 3 static cubes

Code ```rust commands.spawn(( RigidBody::Static, Collider::cuboid(1.0, 1.0, 1.0), PbrBundle { mesh: meshes.add(Cuboid::default()), material: materials.add(Color::srgb(0.8, 0.7, 0.6)), transform: Transform::from_xyz(3.0, 0.0, 3.0), ..default() }, )); commands.spawn(( RigidBody::Static, Collider::cuboid(1.0, 1.0, 1.0), PbrBundle { mesh: meshes.add(Cuboid::default()), material: materials.add(Color::srgb(0.8, 0.7, 0.6)), transform: Transform::from_xyz(3.0, 0.0, 4.0), ..default() }, )); commands.spawn(( RigidBody::Static, Collider::cuboid(1.0, 1.0, 1.0), PbrBundle { mesh: meshes.add(Cuboid::default()), material: materials.add(Color::srgb(0.8, 0.7, 0.6)), transform: Transform::from_xyz(3.0, 0.0, 5.0), ..default() }, )); ```

Setting the NarrowPhaseConfig values to 0.0 seems to solve it but then I fall into or through the ground if I have high vertical velocity. (I guess that's expected)

.insert_resource(NarrowPhaseConfig {
    contact_tolerance: 0.0,
    default_speculative_margin: 0.0,
    ..Default::default()
})
@SakiiCode
Copy link
Author

If I set my collider height to 1.7 then the top of the capsule is at 2.6999664, so I'm actually in the cube. Similar things happen horizontally.

Is this intentional or can it be changed to touch the collider instead of going into it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant