Pretty self explanatory. I would like to get some more information on raycasting if possible. Also i would like to know in what kind of script should i use it
Create a line with an origin and a direction. Ray.new() is used to generate rays, and findpartonray is used to find where they intersect parts or terrain.
https://developer.roblox.com/en-us/api-reference/datatype/Ray
https://developer.roblox.com/en-us/api-reference/function/Workspace/FindPartOnRay