[SOLVED] Bullet's aren't working

        var entity = this.app.root.findByName("bullet").clone();
        entity.enabled = true;
        this.entity.findByName("entity").rigidbody.applyForce(0, 10, 0);

this is the code i am using to clone my template bullet in my fps game. it is fired when i click ‘e’. (i need to change it to the lmb). It’s not working and i can’t figure out why. I would appreciate the help i can get.


Hi @almish_subuk!

Maybe you can try to replace line 2 with:


And line 4 with:

entity.rigidbody.applyForce(0, 10, 0);

You can also try to replace applyForce with applyImpulse. Make sure the rigidbody is dynamic.

Another issue has popped up in my game. I have added a red guy (enemy) to the game, but the collision doesn’t seem to be working properly. When I crash into the enemy with the player, it moves around and can be pushed, but when i shoot the gun, the bullets only rarely hit the red guy. Usually they just go through him. Can anyone take a look at my project and show me the issue?

I think the problem here is that the enemy has a dynamic rigidbody. If you move an entity directly instead of using forces on the rigidbody, the visual entity is moving while the rigidbody stays at the same place. I suggest to use a kinematic rigidbody for your enemy entities.




thanks for all the help. I have figured out the problem, and added a solution. Thanks for helping me out and being cool.

1 Like