I’m creating a Launcher that acts as a mortar as in it doesn’t have a repulsion system but the rockets keep firing out of the side and i don’t know how to fix it.
issue may be related to how you are setting the initial position and orientation of the rocket (Lemon). The Lemon.Position and Lemon.Orientation are being set directly without considering the rotation of the launcher. Additionally, the velocity might not be applied in the correct direction.
try this simplified code:
script.Parent.Activated:Connect(function()
local Lemon = Instance.new("Part")
-- here we set initial pos and orientation based on launcher's pos and rotation
local launcherCFrame = script.Parent.PrimaryPart.CFrame
Lemon.CFrame = launcherCFrame * CFrame.new(0, 0, -5) -- Adjust the offset based on your needs
Lemon.Parent = game.Workspace
-- velocity based on launcher's orientation
local launchDirection = launcherCFrame.LookVector
Lemon.Velocity = Vector3.new(launchDirection.X, 5, launchDirection.Z)
end)