Hi, im making a shooting system. Basically when player presses a button, he fires a bullet in front of him. I used LookVector of HumanoidRootPart of the player
local bulletvector = hrp.CFrame.LookVector
local direction = Vector3.new(bulletvector.X, 0, bulletvector.Z)
and then LinearVelocity to shoot the bullet
atta.Parent = bullet
local LV = Instance.new("LinearVelocity")
LV.Attachment0 = atta
LV.MaxForce = math.huge
LV.VectorVelocity = direction * 100
LV.Parent = bullet
When i stand still, all is good, but problem is when i move backwards. The bullets start going crazy and flying in a “cone”:
My top down camera script works like that:
game:GetService("RunService").RenderStepped:Connect(function()
MousePos = mouse.Hit.Position
hrp.CFrame = CFrame.new(hrp.Position, Vector3.new(MousePos.X, hrp.Position.Y, MousePos.Z))
end)
What could be the issue?