I need to make a gun that shoots forward instead of where the mouse is pointed at, but I can't seem to find a free model with that to steal those lines of script from. I am not asking for you to make one for me, only if you know if this is hard to do or if it already exists as a free model.
A gun that shoots forward?
1 answer
The solution here is actually very simple. I've never done much when it comes to making a bullet shoot towards where the mouse is pointing, but I have done a lot with direction.
I'm assuming you have the classic projectile setup and are not using raycast.
Just as a note: I typically don't answer this type of question. It's not constructive.
All cframes have a lookVector. So for instance. A blocks lookVector is pointing in the direction of it's front is looking at. There are many ways to go about this. I add a block at the tip of the barrel on my gun called main and make sure that part is facing forward. Then I name that part main. When I set up my projectile I set it to that cframe and then apply a force in the direction that block is facing.
The force or velocity is a vector. So is the lookVector of the CFrame of main. If you apply the lookVector of that part to velocity you can send the bullet flying in the direction the gun was facing at the time the shot was fired.
-- Semi pseudo
Velocity = Gun.Main.CFrame.lookVector * Speed
--If your gun doesn't have a Main part then you can use the handle's CFrame
velocity = Gun.Handle.CFrame.lookVector * Speed
-- If for some reason using the handle is not desired you can use the Players head or torso
velocity = Player.Character.Head.CFrame.lookVector * Speed
If you plan on making a shooter game you will need to learn everything you can about vector math. You can't make a good shooter without that knowledge.
Asking someone to do it for you is certainly not going to help you acquire that knowledge.
Here is a page I found incredibly useful when learning vector math. Vector math tutorial
REMEMBER: Google is your friend. Use it as much as possible. You can find many resources like the one I linked above if you do a little searching.
DON'T FORGET: Math is fun!
This discussion is preserved as it was. New answers, comments, and votes are closed.

4 comments
And if I were to use raycast how hard would this get? Raycast does seem like the fancier option nowadays, but I have never been too good with vector mathematics.
Raycast isn't that much different. It take two vectors. The origin and the position the ray should point to. I'm not going to go into anymore detail here. Learn a little more on vector math, practice can't make you perfect but it can make you better. If you have anymore questions SH is always here.
As for raycast being fancier I partially agree. I think a mix of projectiles and raycasts can make for a pretty amazing weapon. Raycast can make calculating the position and rotation of a bullet hole way easier.
In case your not aware, the code in my answer isn't ready to just be thrown into a script. You need to prepare it for use in your scripts. Use the wiki. It does help. Most of it is easy to understand. If there is something you don't understand I'm quite sure SH will be glad to help.