Create a simple machine gun

Hi guys!
In the moment I’m trying to make a gun witch can fire bullets (could be spheres) if you press the left mouse button. But I don’t know how I can do it…

Can somebody help me?
Yours,
Rex Dungeur

Do it step by step. First try to create a playground that displays a console message when the use presses the left mouse button.
Then, I would create a pool (an array) of maybe 10 spheres. And when firing, I’d add an animation to one of those spheres.

First that:
https://playground.babylonjs.com/#UK6WTT#8

And then?

1 Like

check this page Interact with a Scene - Babylon.js Documentation

That’s a cannon witch shoots from alone…
But nice project :slightly_smiling_face:

1 Like

Many demos will not 100% fit your needs, you will need to connect the pieces and make it your own. You have a shooting cannon, you have a way to interact with the scene - put them together and you’ve got yourself a gun :slight_smile:

1 Like

Lol :slightly_smiling_face:

1 Like

very nice

1 Like