Why is my shooting bullet not working properly?

Hi! I’m making an FPS game, but for some reason, my gun won’t shoot properly. It looks like it’s falling down on the ground, rather than shooting objects.

This is my code:

var ShootBulletScript = pc.createScript('shootBulletScript');

// initialize code called once per entity
ShootBulletScript.prototype.initialize = function() {


// update code called every frame
ShootBulletScript.prototype.update = function(dt) {

    if (this.app.keyboard.wasPressed(pc.KEY_SPACE)) {
        var bulletFromTheAsset = this.app.assets.get(137934526);
        var bulletInstance = bulletFromTheAsset.resource.instantiate();

        var bulletPosition = this.bulletEmitter.getPosition();

        this.force = new pc.Vec3();


This is my hierarchy for the gun:

Thank you!

Hi @zero2,

Try using applyImpulse instead of applyForce and adjust the amount you apply. From the manual:

“Apply an impulse (instantaneous change of velocity) to the body at a point.”

Impulse is used when changing the motion state in a single instance whereas force is applied to longer periods of time.

And of course make sure your bullet entity has a collision and dynamic rigidbody component attached.