I am making a string trap setup script, and when you are selecting where the start of the string goes, the string should not go through a wall. This works, except for the own wall that the string is placed on. Here is a video showing the issue:
And this is the code for the raycast:
local raycastResult = workspace:Raycast(stringPosition, (mousePos - stringPosition).Unit * ((mousePos - stringPosition).Magnitude * 0.9999)
I assume this is because the origin of the raycast is placed inside of the part, which means it cannot hit the face of the part. Is there any way around this?
Any help is appreciated.