Hello, I am trying to get the camera’s position and orientation while in editing mode. This would be very helpful when needing to easily determine the good camera view for a cutscene. Something like how Moon Animator does its camera cutscenes.
The camera in roblox works on a coordinate system known as CFrame, you might hear of it before.
Sadly, the roblox camera has no standalone Position value, nor a Orientation value, but instead a CFrame consisting of 2 Vector3s. One Vector3:
Camera.CFrame.Position
Is used to determine its Position and the Second Vector3:
Go to The view tab and click on command bar (If you don’t have the command bar open)
and then type into the command bar:
--for Position
print(workspace.CurrentCamera.CFrame.Position)
--for LookVector
print(workspace.CurrentCamera.CFrame.LookVector)
And then press enter and then go to your output, (Go to the view tab and click output if the output window does not show up) and copy the values needed.
How would I go about getting the camera position in Studio to change? While your information on how to get the coordinates is helpful, it doesn’t tell me how to get the camera in Studio to change to those coordinates.
Correct me if I’m wrong, I think what you are saying is that, after you run the line of code, the value didn’t change.
The lines of code I wrote out isn’t in a loop, so, it’s like taking a picture, the values stay and won’t change, just like a picture. If you need constantly updating values, you need the code inside the loop
BUT DO NOT ENTER ANY INFINITE LOOP CODE IN THE COMMAND BAR, IT WILL CAUSE PROBLEMS.
So, you can only get values that do not update unless you run the code again.