Unified API: User.cameraRotation/User:GetCameraRotation()

It would be great to have a unified way to get the current camera rotation of the user. Currently we need to use cameraEntity:GetRotation() if the camera is a camera entity, Rotation.New(player.cameraPitch,player.cameraYaw,0) if the camera is a player in orbit mode or the unreliable

local cpos,clook=user:GetCameraLookAt()
local crot=Rotation.FromVector(clook-cpos)

which doesn’t work when the player is in front of a wall, looking up or down etc.

Something like user:GetCameraRotation() would be really helpful.

2 Likes