i have a problem with my slash cframe, i want the slash to appear infront of character and its working most of the time but sometimes the slash is rotated more to left/right side of the character or even behind.
video:
code:
local function animLoader(id,speed)
animation.AnimationId = id
local animationTrack = animator:LoadAnimation(animation)
animationTrack:Play()
animationTrack.Priority = Enum.AnimationPriority.Action4
animationTrack:AdjustSpeed(speed)
end
function slash()
local slash = rs.Weapons.Slash:Clone()
slash.CFrame = hrp.CFrame * CFrame.Angles(0,math.rad(90),0)
slash.Attachment.ParticleEmitter:Emit(1)
slash.Parent = game.Workspace.DebrisFolder
end
uis.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.UserInputType == Enum.UserInputType.MouseButton1 and equipped then
coroutine.wrap(function()
task.wait(.35)
slash()
end)()
animLoader(m1Anims[1],1)
end
end)