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

Change RigidBody in system #132

Closed
volodalexey opened this issue Aug 25, 2023 · 2 comments
Closed

Change RigidBody in system #132

volodalexey opened this issue Aug 25, 2023 · 2 comments
Labels
question Further information is requested

Comments

@volodalexey
Copy link

If it possible to change RigidBody ?
I want to change from RigidBody::Kinematic => RigidBody::Dynamic in some system.
I can not find any example how to do this.

@Jondolf Jondolf added the question Further information is requested label Aug 25, 2023
@Jondolf
Copy link
Owner

Jondolf commented Aug 25, 2023

You should be able to just query for the component and set the enum variant:
(haven't tested)

fn my_system(mut query: Query<&mut RigidBody>) {
    for mut rb in &mut query {
        *rb = RigidBody::Dynamic;
    }
}

@volodalexey
Copy link
Author

Ohh. Thanks! I missed this. It ried Query<RigidBody> and got error and I forgot to add &.

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

No branches or pull requests

2 participants