Anti no clip is teleporting me inside of a part?

So this is my anti-noclip script:

As you can see it gets the position, waits a frame, then raycasts between the two frames.
For some reason however whatever part is infront the position gets reset INSIDE of that part causing the player to infinitely rubber band. How is this even possible? I’ve been struggling with this for hours.

example of what happens:
The x and z position aren’t exactly the same as the part but its off by only decimals. Idk how this is possible.

I’ve been super stumped on this so all help is greatly appreciated

1 Like