PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
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