How can i make a projectile face the direction it is thrown at?

im currently working on a script where the projectile will be thrown at the cursor. only problem im having is that the orientation will always be 0,0,0. Is there a way for me to make the projectile face the direction it is thrown?

Code (server script)

game.ReplicatedStorage.Raijin.OnServerEvent:Connect(function(player,mouse,pos)
	local char = player.Character
	local kunai = game.ServerStorage.Kunai:Clone()
	kunai.Parent = game.Workspace
	kunai.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position, pos)
	kunai.Orientation = (player.Character.HumanoidRootPart.CFrame*CFrame.new(0,0,-2)).Position
	local BodyPos = Instance.new("BodyPosition")
	BodyPos.Position = pos --mouse.Hit.Position
	BodyPos.D = 500
	BodyPos.P = 5000
	BodyPos.Parent = kunai
end)

I also tried BodyGyro but can’t seem to figure out how to use it

	local BodyGyro = Instance.new("BodyGyro")
	BodyGyro.Parent = kunai
	BodyGyro.CFrame = CFrame.lookAt(kunai.Position, char.HumanoidRootPart.Position)

This should already achieve the correct orientation in the CFrame.lookAt line, CFrame is both position and orientation, I believe you can just remove kunai.Orientation line from the script, which is weird since .Position is not equal to .Orientation mathematically by definition.

game.ReplicatedStorage.Raijin.OnServerEvent:Connect(function(player,mouse,pos)
	local char = player.Character
	local kunai = game.ServerStorage.Kunai:Clone()
	kunai.Parent = game.Workspace
	kunai.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position, pos)
	local BodyPos = Instance.new("BodyPosition")
	BodyPos.Position = pos --mouse.Hit.Position
	BodyPos.D = 500
	BodyPos.P = 5000
	BodyPos.Parent = kunai
end)

image
I removed the orientation line and it seems to work. but the X-Axis doesnt really match. Is there a way i can change it?

Hi i managed to find a way to rotate the X-Axis

	kunai.CFrame = CFrame.new(player.Character.HumanoidRootPart.Position, pos) * CFrame.Angles(math.rad(-90), 0, 0)

It works perfectly now, thanks for the help!

Instead of this you should rotate the kunai being cloned -90 degrees around the X-axis, such that this * CFrame.Angles(math.rad(-90, 0, 0)) bit doesn’t need to be executed for each cloned kunai.