What I mean is that if I made a ray start at the gray part where my mouse is hitting, it would stop at the red part. If you don’t understand still:
The ray would end at the purple part because I’m raycasting straight down from the mouse hit position. How would I avoid it detecting parts that are directly under it like the red part to the gray part?
ULTIMATELY it ends up making the rope very short if a part is under the part where the mouse is
I see but the player can place the rope anywhere, which means I can’t turn off CanQuery for every part. I want it to ignore the part if the surface angle between the two is 180 degrees if you know what I mean.
Ok I read over your initial question so let me know if I’m still not understanding it correctly.
Basically what you’re trying to achieve is create a rope that reaches all the way down to the nearest ground from the point you clicked with your mouse, but because the raycast starting position is too close to the wall it detects anything under that initial part even though they are completely aligned?
In that case I would add a slight offset that goes the opposite direction of your mouse click such that the target position isn’t right up against the wall.
I just want to add that ideally you’d probably want the rope to offset in the opposite direction of the target face you clicked on. This might be slightly farfetched but you could run two separate Raycasts to do this since there is a property called “Normals” that RaycastResult returns
This is basically a direction vector which you could use to offset the rope slightly in the direction that the face you clicked on is looking at (this works with custom meshes too I believe), then cast the second Raycast downward from this new position to get the length you need for the rope