Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2022 05:20
What would you like to do?
function shoot () {
const ballInstance = bullet.createInstance("ballInstance");
ballInstance.physicsImpostor = new BABYLON.PhysicsImpostor(ballInstance, BABYLON.PhysicsImpostor.SphereImpostor, { mass: 1, friction: 0.2, restitution: 0.2 });
ballInstance.applyImpulse(ray.direction.scale(impulseMagnitude), bullet.getAbsolutePosition().add(contactLocalRefPoint));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment