PcoWSkbVqDnWTu_dm2ix
The Developer Hub is now deprecated and information on this page may no longer be accurate. To see our new and improved documentation, please click here. You can read more about the future of documentation here.
Collapse Sidebar

GetRenderCFrame

This function returns the actual DataType/CFrame of the Camera as it is rendered. This includes any roll applied using Camera/SetRoll and the impact of VR.

VR head transformations, along with roll applied using Camera/SetRoll is not applied to the Camera/CFrame property. For this reason, it is best practice to use Camera/GetRenderCFrame to obtain the ‘true’ DataType/CFrame of the Camera.

For example, when using VR the Camera is actually rendered at the following DataType/CFrame:

local UserInputService = game:GetService("UserInputService")

local headCFrame = UserInputService:GetUserCFrame(Enum.UserCFrame.Head)
renderCFrame = workspace.CurrentCamera.CFrame * headCFrame

The Camera|Camera’s render DataType/CFrame will only be changed to account for the head when the Camera/HeadLocked property is true.

Returns

Return Type Summary

The DataType/CFrame the Camera is being rendered at