Hey guys,
I’m currently using a rudimentary LOS system to detect a wall on any side of the player regardless of player position or map. Basically if a point 1.5m away from the eye position of the player in the cardinal directions is blocked from seeing the player, it returns that the player is “touching” a wall. This method works, however it honestly does not feel like the best solution.
I figure that a raycast hit could work in the direction of the velocity of the player, however since players have gravitational decay on their trajectory it isn’t the most accurate method. Since the player does not always contact that position, I’m not sure how to measure distance. Increasing the radius of detection (for example using players within radius) increases the radius of detection in a sphere, when I would like to only detect when they hit a wall.
I was wondering if there was any way to use raycasts or a simpler condition to check if the player is touching a wall independent of map or coordinates. Preferably this method would be accurate to 1m of where the player touches the wall and wouldn’t use LoS pseudo detection because of the server slowdown.
Thanks!
Code with basically what I am using now to detect as a condition (don’t yell at me it’s way too long I know): AA9FJ