the camera is a shoulder camera, google how to make one of those
the raycast can be done by seting the origin to be the barrel of the gun and the crosshair doesnt matter, im assuming thr crosshair will always be in the middle of your screen so all you need to do for the direction of the cast is
1) How would you achieve this kind of camera?
I think this is the camera like shiftlock?
2) How would you be able to raycast using a corsshair?
You can use this script given below:
local UserInputService = game:GetService("UserInputService")
local mousePosition = UserInputService:GetMouseLocation()
local camera = workspace.CurrentCamera
local function MouseRaycasting()
local mouseRay = camera:ViewportPointToRay(mousePosition.X, mousePosition.Y)
local raycastResult = workspace:Raycast(mouseRay.Origin, mouseRay.Direction * 1000)
return raycastResult
end
Wtih raycastResult.Instance, you can get the part that the cursor is clicking/hovering.