How would I go about getting all the parts that is within view of a players screen?
Thanks.
Sorry for a year(!)'s delay, but ROBLOX just released a Camera update:
local pos, vis = workspace.CurrentCamera:WorldToScreenPoint(workspace.Part.Position) if vis then print("Point is Visible on screen!") end
You can use this to loop through every part you care about to see if it's Visible. On it's own, this isn't perfect, but it's a good start.
Not quite sure on how the FieldOfView property works for Camera's, but couldn't you cast a bunch of ray's within a (FieldOfView?) degree radius to try and find every part? After all, even if you could get Region3 to work or something like MrNicNac suggested, you would end up with parts that were hidden behind walls as well. The only way to counter that is to use raycasting. But if that's fine, then you can try this...
1) Get every BasePart in workspace 2) Use (http://pastebin.com/54QJiii6) in order to get the closest point on a part from your camera's position 3) Compare the unit vector of your camera and the unit vector from your camera to the point on the part. If it is within # degrees/distance of each other, then at least some section of it is on the screen