.Touched or RayCasting for meele weapons?

What should I use? because sometimes with the following code;

local hit,pos,surface,material = workspace:FindPartOnRayWithIgnoreList(Ray.new(self.Player.Instance.Character.HumanoidRootPart.CFrame.Position,self.Player.Instance.Character.HumanoidRootPart.CFrame.LookVector.unit * self.Range),{self.Player.Instance.Character})

It doesn’t detects correctly

This isn’t all too informative - in what way doesn’t it detect correctly? What were you expecting, vs. what you’re seeing?

To answer the question posed in the title, however, I recommend raycasting; .Touched events are often delayed and sometimes don’t fire at all. Pre-made modules for melee raycasting exist, like this one:

If you wish to perform the raycast client-side to give faster hit feedback, just be sure to also perform a sanity check on the server.

Well, it should detect a ray in FRONT of HumanoidRootpart, it works, but sometimes, it just doesn’t makes it well or doesn’t detects when I’m in front.

This seems like a good reference: Raycast for Sword hit detection

(I’m no pro on raycasting haha)