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!