I'm making a grappling hook and I previously had made it so a raycast is made from the player's view direction but I found that it was hard to aim and inaccurate a decent amount of the time.
here's my idea for how to make it a little more intuitive, the player will make a raycast from their head to every grapple point. as long as the ray is unobstructed it is a valid POI it is valid. the grappling gun will shoot at the POI with the most similar direction or rotation to the players view and use that for the grapple.
the problem is that I don't know of a lightweight way to check within 18 block radius of the player for these blocks without it getting really laggy trying to check every block every tick.
I was thinking about making a 2d array of raycasts from the players view but thought it could be inaccurate and laggy moreso than this new method.