Tank shooting in random directions

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    i wanna achieve to make a Sturmtiger tank, ofc its fire range is limited

  2. What is the issue? Include screenshots / videos if possible!
    the shots go basically nowhere, even when i set them to go from Attachment’s WorldCFrame.LookVector, and i know that the front of the attachments is straight forward not backwards.
    Uploading: test thing idk - Roblox Studio 2022-09-25 13-49-07.mp4…

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I didn’t because the code is literally correct, the Attachment’s cframe.LookVector is at the front of the tank so why is it shooting in random directions???

Code which manages the position:

if UIS:IsMouseButtonPressed(Enum.UserInputType.MouseButton1) then
	local calc = Model.Rockets.Main:FindFirstChild("1").WorldCFrame.LookVector*12
	calc = calc*Vector3.new(1,0,1)
	calc = Vector3.new(calc.X,game.Players.LocalPlayer:GetMouse().Hit.Position.Y,calc.Z)
	Model.SHOOT:FireServer(calc)
end

*fire angle not fire range
also if the video is not loading, tell me so i can reupload it cuz i think it didnt upload

you are getting the height from the mouse-position and putting that in a direction vector, this is possibly what is causing the issue.
What do you want to happen with the mouse position, is it the where the projectile should land?
(The video is indeed not loading)

i want it to shoot where the turret’s CFrame.LookVector is, but only the Y axis to be different than it so player can shoot upwards.

reuploaded video: tonk. - YouTube(uploaded on youtube cuz devforum uploading sucks)

What happens if you keep the Y at 0.
are you sure that the Y is used for the hight-angle.
depening on your method, you could’ve messed up the vectors and they can swich around.

at Y 0 it just shoots underneath and damages the tank.

What is your method of firing the projectile, you might be using radians or degrees instead of unit vectors

the localscript fires event to shoot with the calculated position, then the server script raycasts to reach that position

also i just realized the bullet is just going to (0, (Y), 0) position for some reason

Ah now i understand what the script is doing.
The code from above is indeed flawless, the problem lies somewhere else.