I'm trying to implement a function where I detect the parts in front of a player that are within a set field of view. You can imagine it in a shape of a cone as seen in this image
I already succeeded in implementing a single line raycast to check the part in front of the player but I'm not sure how to do it in a widespread multi-part approach. The brute force approach would be to continuously cast from a minimum angle direction to a maximum angle direction but I think that's resource intensive considering this is done every time the mouse is clicked while a specific tool is equipped.
So is there any way to do this with Raycast or is there a more effective solution? Thanks in advance.

1 comment
I haven't tested this solution yet but this might work. I just had to resolve using a transparent part as a front collider to detect parts that it touched. The designer gave me additional specifications that made raycasting seem unsustainable. Thanks for the response.