LookVector staying the same value

Hi!
This happens so often to me, basically everytimes I’m trying to script something that includes LookVector.
This is my script:

local Sword = script.Parent
local Handle = Sword.Handle
local swordSlash = game:GetService("ReplicatedStorage").SwordSlash

local function Sword_Slash(char)
	local swordSlashClone = swordSlash:Clone()
	swordSlash.Position = Handle.Position
	local BP = Instance.new("BodyPosition")
	BP.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
	BP.Position = (char.Head.CFrame.LookVector * 100)
	BP.Parent = swordSlash
	swordSlash.Parent = workspace
end

Sword.Activated:Connect(function()
	--He clicked, make it so it slashes
	local char = Sword.Parent --Sword.Parent is the Character now
	Sword_Slash(char)
end)

but the problem is, that the swordSlash is not facing the right direction.
Here is a video about the behavior:
https://streamable.com/lnvld6

Notice how the first time it works fine, it does match the direction of my head but after that it just breaks or something.
As I said, this happens to me everytimes I’m scripting something that includes LookVector.
Am I doing something wrong?
Thank you!

If you are using BodyPosition to move the sword slash, then the way the vector math for how the BP.Position is being handled is not what you expect.

You would have to Position this BP.Position in front of the characters look vector relative to world space This means you would need to include the position of the head then add the direction of where the head is looking like so:

	BP.Position = char.Head.CFrame.Position + (char.Head.CFrame.LookVector * 100)
1 Like