I am very confused on how the directional element of raycasts work. I have created an anti-noclip script with raycasts in the HumanoidRootPart that rubberbands the player if they are in a wall. It works phenomenally at preventing noclipping, but the issue is walking up against a wall causes rubberbanding. How should I be casting these rays?
the rayDirection is the direction the ray is casted with the length being the number input on the axis it’s casting to (in your case it will be 1) in studs, think of it as poking a 1 stud long part around your character. the problem you’re encountering is that your raycast is touching the wall while the player is not inside it due to the ray being too long, you can try changing the length and see which works best while still keeping it functional
I don’t believe it’d be possible to get it to the perfect length that keeps it functional and short enough to not reach walls while not inside them, this approach would only be able to minimize the effect, I’d recommend trying different methods of preventing noclips if this compromise isn’t ideal