How could I make my arm move away/with the wall instead of pushing the character around

My arms are cancollide true and collide with walls to combat some stuff but when moving my arm against a wall it pushes the character, how could I make it so the arm moves to avoid the wall and doesnt move the character

Here is an example
https://gyazo.com/700d9c33a1132bef72af72c20904d199

local ArmOffset = Character.Torso.CFrame:Inverse() * Character["Right Arm"].CFrame
local RightOriginal = CFrame.new(1.5, 0, 0)

RunService.RenderStepped:Connect(function()
	
	if Pointing == true and ArmWeld then
		local ArmFrame = CFrame.new(Character.Torso.Position, Mouse.Hit.Position) * CFrame.new(-0.5,0.4,-2) * CFrame.Angles(math.pi/2, 0, 0)
		local ArmGoalR = ArmOffset * Character.Torso.CFrame:toObjectSpace(ArmFrame)
		
		ArmEvent:FireServer(ArmGoalR, ArmThreshold)
		
		ArmWeld.C0 = ArmWeld.C0:Lerp(ArmGoalR, ArmThreshold)

	elseif Pointing == false and ArmWeld then
		
		ArmEvent:FireServer(RightOriginal, ArmThreshold)
		
		ArmWeld.C0 = ArmWeld.C0:Lerp(RightOriginal, ArmThreshold)
		
		
	end
	
end)

I’d recommend using raycasts and creating a tag for things you want the player’s arm to avoid. You can use CollectionService to check for the tags

1 Like

Alright I’ll try raycasts, any tips?