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

How would I get the rotation of the player's camera?

Asked by 5 years ago

I don't have a script to put down as I'm looking for a straight-forward answer/explanation. I do not need for you to give me a script, more so point me in the right direction.

0
what is this for? User#5423 17 — 5y
0
I made a radar, but I want the radar to rotate with the players' camera's orientation. basicecstasy 122 — 5y

1 answer

Log in to vote
1
Answered by
CPF2 406 Moderation Voter
5 years ago
Edited 5 years ago

you can find the CFrame of the Camera simply by doing

workspace.CurrentCamera.CFrame

From this point on you can do a lot of things, like get the LookVector of the camera, or if like in the question, you want the rotation of it, you can use toAxisAngle

local CameraRotation = workspace.CurrentCamera.CFrame:toAxisAngle()

EDIT: Although obvious to some, it should be noted that this script will only work from the Client.

Ad

Answer this question