You can write your topic however you want, but you need to answer these questions:
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
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…
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
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)
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.