Skip to content

Stop a rigid body #448

Description

@APerricone

Hi, In my project I would like reuse some rigid body, so stop them, move and sleep, I tried with:

reset(world :World) {
    let collider = world.getCollider(this.colliderId);
    let rigidBody = collider.parent()!;
    rigidBody.setTranslation(new Vector2(0,settings.ballHeight), false);
    rigidBody.setNextKinematicTranslation(new Vector2(0,settings.ballHeight));
    rigidBody.setRotation(0, false);
    rigidBody.setNextKinematicRotation(0);
    rigidBody.resetForces(false);
    rigidBody.resetTorques(false);
    rigidBody.sleep();
}

But it is still awake.
It is TypeScript but I think the same issue is present with javascript and rust.
I am using the 0.11.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions