getLinearVelocity() with Havok plugin

Hi guys, I’m using havok plugin but I can’t access le linear velocity property of my hitboxRuotaAggregate object. Unfortunately I can’t share my code in a playgrond, someone can help me sharing the code to access the velocity of the hitboxRuotaAggregate object? This is my code, thank you very much: ` hitboxRuota.position.x = -0.613;
hitboxRuota.position.y = 0.888;
hitboxRuota.position.z = -0.260;

    hitboxRuota.isVisible = false;

    hitboxRuota.addChild(ruota);

    hitboxRuotaAggregate = new BABYLON.PhysicsAggregate(hitboxRuota, BABYLON.PhysicsShapeType.BOX, { mass: 0.5, restitution: 0.8, friction: 1 }, scene);
    hitboxRuotaAggregate.body.disablePreStep = false;
    
    hitboxRuota.position.x = -0.615;
    hitboxRuota.position.y = 0.850;
    hitboxRuota.position.z = -0.262;`

These lines should be enough to get linearvelocity:

currentVelocity = new BABYLON.Vector3();
hitboxRuotaAggregate.body.getLinearVelocityToRef(currentVelocity);
4 Likes

You are a genius

1 Like