Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to get the player camera's cone of view?

Asked by
Benbebop 1049 Moderation Voter
4 years ago

I looked in-game and cant seem to get the dimensions of the player's cameras (by cameras I mean VR cameras, since 3D requires two cameras I would need to find both of them). For this specific instance the cone of view and the minimum distance an object can be from the camera before not being rendered.

Specifically, my problem is that I don't want players to be able to just put their head in a wall and see everything. So when the camera is intersecting with an object it blacks out the screen. But I know how to code all of that already, my only issue is the one above.

1 answer

Log in to vote
1
Answered by 4 years ago

Try this

local camera = workspace.CurrentCamera
local playerView = camera.FieldOfView
0
How do I seperate the two cameras involved in VR 3D, if two even exist that is. Benbebop 1049 — 4y
0
well I figured it out, it worked in the end. Benbebop 1049 — 4y
Ad

Answer this question