How to make punch from far away?

Hi there i have a problem with my punching system and I’m not sure how to fix it.
My punching damage only plays when its very very close to a player here’s an example:

Here are the codes i have used:
StarterCharacterScripts:

local Players = game:GetService("Players")
local RStorage = game:GetService("ReplicatedStorage")

local Player = Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait()
local Remotes = RStorage:WaitForChild("Remotes")
local Punch = Remotes:WaitForChild("Punch")
local Mouse = Player:GetMouse()
local Animation = script:WaitForChild("Animation")
local CanDamage = true

Mouse.KeyDown:connect(function(Key)
	if Key == "f" then
		if CanDamage then
			CanDamage = false

			local Humanoid = Character:WaitForChild("Humanoid")
			local PunchAnimation = Humanoid:LoadAnimation(Animation)
			local punchsound = game.Workspace.Punchsound -- sound in workspace
			PunchAnimation:Play()
			punchsound:play()
			Punch:FireServer()
			wait(1)
			CanDamage = true
		end
	end
end)

ServerScriptService:

local RStorage = game:GetService("ReplicatedStorage")

local Remotes = RStorage:WaitForChild("Remotes")
local Punch = Remotes:WaitForChild("Punch")
local Connection

local function DealDamage(Part)
	local Character = Part.Parent
	local Humanoid = Character:FindFirstChild("Humanoid")
	if Humanoid then
		Humanoid:TakeDamage(10)
		Connection:Disconnect()
	end
end

local function PlayerPunch(Player)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	local RightHand = Character:WaitForChild("RightHand")
	
	Connection = RightHand.Touched:Connect(DealDamage)
	
	wait(0.5)
	
	Connection:Disconnect()
end

Punch.OnServerEvent:Connect(PlayerPunch)

I would like to make that the damage starts at 1-2 studs away from player.
Any help counts thanks.

Make the hitbox bigger from the fist.

You can do a magnitude check instead of the .Touched event.

local RStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")

local Remotes = RStorage:WaitForChild("Remotes")
local Punch = Remotes:WaitForChild("Punch")

local function DealDamage(Part)
	local Character = Part.Parent
	local Humanoid = Character:FindFirstChild("Humanoid")
	if Humanoid then
		Humanoid:TakeDamage(10)
	end
end

local function PlayerPunch(Player)
	local Character = Player.Character or Player.CharacterAdded:Wait()
	local RightHand = Character:WaitForChild("RightHand")

	for i,v in pairs(Players:GetChildren()) do 
		if (v.Character) and (v.Character:FindFirstChild("HumanoidRootPart")) then 
			local EnemyRoot = v.Character.HumanoidRootPart
			
			if (EnemyRoot.Position - RightHand.Position).Magnitude <= 2 then 
				return DealDamage(EnemyRoot) --// Remove the return if you want the punch to be able to hit multiple targets.
			end
		end
	end
end

Punch.OnServerEvent:Connect(PlayerPunch)