how do i get root rigid body from collider entity? #780
|
I'm getting an entity from a raycast, and I need to get the root rigidbody from that entity. I also need to access collider properties, such as friction or mass. |
Answered by
ThierryBerger
Jan 5, 2025
Replies: 2 comments 2 replies
|
i use bevy rapier 3d btw. |
0 replies
|
From the To access the collider properties, as you have the Collider entity, you can query for its related components listed in https://docs.rs/bevy_rapier3d/0.28.0/bevy_rapier3d/geometry/struct.Collider.html. |
2 replies
Answer selected by
Nigless
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
From the
RapierContextyou can retrieve the rigidbody with https://docs.rs/bevy_rapier3d/0.28.0/bevy_rapier3d/plugin/struct.RapierContext.html#method.rigid_body_entityTo access the collider properties, as you have the Collider entity, you can query for its related components listed in https://docs.rs/bevy_rapier3d/0.28.0/bevy_rapier3d/geometry/struct.Collider.html.