I have been trying to make a knife I can throw and I have tried a lot of different things but it won't work. Every time the knife is thrown it is facing upwards and not to the area I clicked (it does move positions based on where I click but that's it).
local KnifeEvent = game.ReplicatedStorage.KnifeThrow
local knifeFolder = game.Workspace.Knifes
local range = 3000
KnifeEvent.OnServerEvent:Connect(function(player, mousePos, origin, originPos, pointer)
--local direction = (mousePos - originPos).Unit * range
--local result = workspace:Raycast(originPos, direction)
local direction = (mousePos - originPos)
local target = mousePos
local knifeClone = origin:Clone()
knifeClone.Anchored = true
knifeClone.CanCollide = false
knifeClone:ClearAllChildren()
knifeClone.Parent = game.Workspace
knifeClone.Name = (player.Name.. "Knife")
local pointerClone = pointer:Clone()
pointer.Anchored = false
pointerClone.CanCollide = false
pointerClone:ClearAllChildren()
pointerClone.Parent = game.Workspace
pointerClone.Name = (player.Name.. "pointer")
local weld = Instance.new("Weld")
weld.Part0 = knifeClone
weld.Part1 = pointerClone
weld.Parent = pointerClone
local pointerPos = pointerClone.Position
local direction = pointer.CFrame.LookVector*range
local ray = Ray.new(pointerPos, direction)
print("KnifeCloneMade")
local part = workspace:FindPartOnRay(ray, pointerClone)
print(part)
end)
Please give me any advise you can give.

1 comment
please include the script that throws the knife, I don't see anything here involved with motion.