My game shooting

this is my game cool thing(multiplayer) - PLAYCANVAS i need help with shooting. I want it to shoot wherever the player is facing, please reply and help.

Hi @jus.co_ding_me_23,

You will have to apply a force to your projectile to the direction of movement, something like this:

var forcePower = 1000;
var direction = this.player.forward.clone();

There also a lot of older threads on the subject, try searching the forums for “shooting”.

1 Like

Hey @jus.co_ding_me_23,

In addition to what @Leonidas said, you can take a look at this tutorial - This gives a very good introduction to both a shooting mechanism, as well as the playcanvas scripting and physics system in general.

1 Like

thanks you guys, it really helped