How do you get the position of a camera and display it onto text?

yes, you can round each number to make it more visually appealing. But you should try @Cloudbots solution. He is formatting the string so it looks easier to read. Will respond to any messages below this tomorrow morning.

Still doesn’t work. But even if it did is there any way to convert it into a Vector3 value?

CFrame Positions are a Vector3 value?

I mean, a Vector3 value like, a part position value (Like (50, 100, 25)). Because I’m not sure if @beyblader78601’s code was a Vector3.

Easy; Use the orientation instead. It will format correctly.

script.Parent.Text = tostring("Position: ("..camera.CFrame.Orientation..")"

In addition, if you want the result to be integers, use math.round().

Got an error: “Orientation is not a valid member of CFrame”

Interesting, it shouldn’t error. Possibly try camera.Orientation

Nope, same thing. Here’s what I’m trying:

local camera = workspace.CurrentCamera

while true do
	task.wait()
	script.Parent.Text = tostring("Position: ("..camera.CFrame.Orientation..")")
			
end

(Even when it was just Camera.Orientation).

LOL, I should not be working this late. Anyway, Camera doesn’t have orientation, funny story; Which is why you got the error! Try this, it should be more reliable, haha. :sweat_smile:

local camera = workspace.CurrentCamera

while true do
	task.wait()
	script.Parent.Text = tostring("Position: ("..camera.CFrame:ToEulerAnglesXYZ()..")")
			
end
1 Like

Works, but it’s still like this.
image

May I ask what this is for? If this is for a position on the map of the character, why not use the HumanoidRootPart.Position? It will get you the result you want, with less hassle! :smiley:

Ah, yeah. I now realize that that probably would have been better. Thanks y’all for the help (although in the end I probably don’t even need it). Sorry about the trouble.

1 Like