Making arm not going through body

image_2024-12-07_191839929

as you can see in the image my arm is going through the other parts which doesn’t look very good.
i was wondering if anyone would know how to make it so the player either gets blocked from moving their are if its going to go into something or simulating collision.
im using positioning while anchoring so my current method cant use roblox physics to stop the part from moving.

code:

--GrabModel is the part connecting the two points that im having troubles with

--local (main handler)
while task.wait() do
	local grabModelCF = CFrame.lookAt((self.ShoulderAtt.WorldPosition+self.TargetAtt.WorldPosition)/2,self.TargetAtt.WorldPosition,Vector3.new(0,1,0))*CFrame.Angles(math.rad(90),0,0)
	local grabModelSize = Vector3.new(1,(self.ShoulderAtt.WorldPosition-self.TargetAtt.WorldPosition).Magnitude,1)
		
	game.ReplicatedStorage.TransformGrabArm:FireServer(self.GrabModel,grabModelCF,grabModelSize)
	self.GrabModel.CFrame = grabModelCF
	self.GrabModel.Size = grabModelSize
end

--server (remote event)
game.ReplicatedStorage.TransformGrabArm.OnServerEvent:Connect(function(plr,grabModel,modelCF,modelSize)
	grabModel.CFrame = grabModel.CFrame:Lerp(modelCF,0.3)
	grabModel.Size = grabModel.Size:Lerp(modelSize,0.1)
end)

This seems easy to do with cylinderal constraints but i so far havent gotten cylinderal constraints to work.

You might be able to use Raycasts to get a position where the arm first meets the parts.