How would I make a shotgun work in a top down shooter?

I want to make a shotgun where, in the direction the player’s mouse is pointing, it fire’s several pellets at slightly different angles.

You could make the shotgun an attached object, with mouse move and point on so it alway points to the direction of the mouse. Then when you click, connect three to five emitters that emit a bullet. You change the angle in the behavior settings (when you click on the emitter) I can’t send an example right know since I’m on mobile, but I’m sure someone can explain this further.

1 Like

Here’s an example with just the shotgun functioning in a space. I’m sure you could attach it to whatever if needed. You could also have more than 3 bullets if that works for you. https://flowlab.io/game/view/1571161

2 Likes

Check out both ideas posted already. In addition, you could use some raycasts at either set or slightly random angles. The rays would act as the bullets and could check if anything is hit.

2 Likes