Need Help Coding Gun System For 2D Game


#1

I am planning on adding a gun for a player, but I don’t know how to code such a system. Does anyone know how to code a gun in playcanvas?


#2

Are you creating your game using a 1st person or 3rd person perspective?


#3

Well it isn’t 3D. It’s for a 2D game. It should be able to shoot on a key press and maybe mouse cursor can be used to change angle of the gun.


#4

This would be an excellent tutorial to reference for that particular game mechanic:

PlayCanvas 2D Space Shooter Tutorial