Hello!
I’ve been fiddling with raycasting and it doesn’t behave as expected
a demo of the problem
As shown in the video, raycasts act weirdly when you’re angled nearly parallel to the angle of the face of the part, and on the edges of the face (not the topological edges), detecting an intersection where it shouldn’t be.
What’s more is that they don’t even detect intersections with the part if the face you’re facing is thin (shown in the video as well)
also if you’re close enough to the part, you can make areas near the edges detect, this is the closest i managed to get it (the red line is a ray)
and the rays dont reach the wall, in some cases when you update the rays too frequently they actually overshoot past the wall’s boundaries and go through them
On the forum I haven’t been able to find a solution for this exact problem, only some specific case when the ray is intersecting the part directly on the topological edge
Perhaps the problem is in my script, it casts a ray originating from the player’s head and ending at 100 studs infront of it, with some offset to the left/right, depending on the variable i
demo:
raysrc.ray() is a function from a module i made to simplify visualizing raycasts, i dont think it has anything to do with this problem, also note that the distance
is how much studs away will the raycast’s end goal be at
Is this problem involved with the script or with roblox’s raycasting?