Finding closest path to raycasted part

Hi, I’m trying to find closest position to wall from where player is standing, and I’m not sure how to do it.

The closest position would be one perpendicular to wall and facing the player

The wall itself is found via raycast, raycast orientation is where the player is facing, and I need to find point X.

Y axis may be disregarded, this just needs to work on X and Z axis.

Thank you for your help

1 Like

Alr so i ended up fixing it, if you find this post and have the same issue, here’s the solution:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.