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

CollidingEntities component, doesnt seen to work with sensors. #538

Open
Sirmadeira opened this issue Jun 21, 2024 · 2 comments
Open

CollidingEntities component, doesnt seen to work with sensors. #538

Sirmadeira opened this issue Jun 21, 2024 · 2 comments

Comments

@Sirmadeira
Copy link

Sirmadeira commented Jun 21, 2024

Hello, so this specific component. Is broken

https://docs.rs/bevy_rapier3d/latest/bevy_rapier3d/geometry/struct.CollidingEntities.html

Doesnt seen to be working as expected . As you can see in the video below
Gravação de tela de 21-06-2024 14:42:43.webm

The function collision event is detecting correctly the collisions among sensors.
But for some unknown reason it doesn't "fill up" the CollidingEntities component.

Sample codes:


fn display_events(
    mut collision_events: EventReader<CollisionEvent>,
    mut contact_force_events: EventReader<ContactForceEvent>,
) {
    for collision_event in collision_events.read() {
        println!("Received collision event: {:?}", collision_event);
    }

    for contact_force_event in contact_force_events.read() {
        println!("Received contact force event: {:?}", contact_force_event);
    }
}

pub fn detect_hits(
    colliding: Query<&CollidingEntities>,

){
    
    for p in colliding.iter(){
        for i in p.iter(){
            println!("{:?}",i);
        }
    }
}

@Sirmadeira Sirmadeira changed the title CollidingEnitites component, doesnt seen to work with sensors. CollidingEntities component, doesnt seen to work with sensors. Jun 21, 2024
@xx1adfasd
Copy link

Did you add the ColllidingEntities component manually to the Player? Because I just switched from avian to rapier, and I found out that avian automatically add ColllidingEntities for you, but in rapier you need to add the component by yourself.

@Sirmadeira
Copy link
Author

Yeah I did still broken, it just doenst detect any entity whatsoever

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

2 participants