I’m making slashes for my combat system and I want to apply impulse in the direction the character is facing. For some reason the slashes always go in one direction, I believe the issue has something to do with CFrame.
Do you have any solutions?
Server Script
local function AddEffects()
local Clone = game:GetService("ServerStorage").SlashEffect:Clone()
Clone.Parent = workspace
Clone.Position = character.HumanoidRootPart.Position
Clone.Velocity = Clone.CFrame.LookVector * 20
local Db = true
if Db == true then
Db = false
local NewPosition = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-5) * CFrame.Angles(0, 0, math.rad(90)).Position
Clone:ApplyImpulse(NewPosition * 20)
wait(1.5)
Clone:Destroy()
end
end
Thank you.