How do i make a gun that can shoot projectiles?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Fob823

I want an object[gun] to spawn if some variable == 1, and that gun should be to the right of the player and the gun should face where the cursor is. I’ve completed the face where cursor is, and the right to player I can do later, right now I’m just wondering how I can make a gun that can shoot projectiles when mouse button left is clicked. keep in mind im a noob and i can’t even code a single line, except for a variable.

:bust_in_silhouette: Reply From: 0sait05

If it’s for 2d see this youtube video.
by the way, I’m new to coding so sorry if I cant help, but ill try my best to help you!
https://www.youtube.com/watch?v=ohV8BK6ixY4

Video is only 6 months old so should work with your project.
Older video is hard for beginners as they don’t work some times.

0sait05 | 2019-09-30 18:44