I want to make it so that the player only has 1 view, which can be seen from a specific POV.
So, how I can set the orientation and position of the players camera?
Much (exactly) like a part, the camera uses CFrames (coordinate frames) which contain positional and rotational data to define its position and rotation in the world (workspace).
You should read this tutorial to get into CFrames and then this to get into manipulating the camera.
But as a shorthand method, you can do something like:
local pos = CFrame.new(x,y,z)
local rot = CFrame.Angles(rX,rY,rZ)
camera.CFrame = pos * rot
Note that rX, rY and rZ are in radians which you can get from degrees by doing math.rad(deg)
where deg
is the angle in degrees.
If you don’t have a good idea of radians, is their any other easier way to do this?
You can just convert degrees to radians by using the rad function of the math library.
CFrame.Angles(0, math.rad(90), 0)
1 Like
No, radians are the only type of argument that rotational arguments of CFrames can take.
^^^
1 Like