Problem with my recent gun script

Hello fellow developers! I’m here because I’ve recently come across an issue with a gun system I made. Pretty much the problem is that the bullets wont face the way a player clicked, I’m trying to make it so when you click, the bullet will turn to face the way you clicked with your mouse. Everything else works fine, the bullet appears and the Body Velocity pushes it the way you clicked but its just facing forward and I want it to point to where your mouse is so it actually looks realistic and not a bullet moving to the side but for some reason facing straight ahead. I’ve watched many tutorials but none I found seem to include what I want. Any solutions to the issue?


This article from the wiki should be able to help you out.

Use LookVector. If you’re adding a body velocity to the bullet then just make the velocity face the way the player is facing.

local Speed = 69 -- your amount of speed here

BodyVelocity.Velocity = Character:FindFirstChild("HumanoidRootPart").CFrame.LookVector * Speed

(Apologies, I just realized you meant facing the mouse, I have no idea how to do that lol. If you ever decide to change it to the way the character is facing then this would work.)