Viewport camera coordinates (x,y,z)?

For every new project I open I find myself going through the same process of cutting/pasting a Blueprint template just so I can check my viewport camera’s xyz world position (for debugging purposes).

Is there a basic stats/debug option somewhere in the editor that can be turned on to display the current viewport camera’s xyz coordinate?

Hey ash22,

I’m not currently aware of any way to get the world position of the Viewport camera. It’s not an Actor, so I don’t think it can be referenced as such through the Editor.

You can set Bookmarks, however. Bookmarks remember the location and rotation of the camera. To create a Bookmark, press Ctrl + a number 1-0. Pressing that number will return the camera to that Bookmark.

You can also create a Camera in the position of the Viewport camera by using the Viewports Options dropdown in the upper-left corner and selecting Create Camera Here.

There’s some more information on Viewport Options here:

https://docs.unrealengine.com/latest/INT/Engine/UI/LevelEditor/Viewports/ViewportOptions/index.html

Hope that helps!

Thanks Ben.
My mistake — when I refer to camera I actually mean player_controller/character_controller (character.h). Not sure if that makes a difference to your answer.

Anyway, I think my solution is to put my DrawText->dump.xyz.coords.to.screen graph template into the globally accessible Blueprint library. That way I should be able to conveniently drag it into any project.

It’s a pity that newlines don’t work in DrawText. It would make my stats & debugging DrawText node graphs much simpler/cleaner.

How the F*CK is it possible that it is so hard to get the camera position in unreal?! this is ridiculous !

I was looking for an unrelated post but I figured since there was no answer on this, I would throw one in for future people. It’s possible this was added in a more recent version and wasn’t present in 2017, but who knows.

GetPlayerCameraManager has all the info you need for camera position and more.

You can also GetPlayerController->GetViewTarget for some additional information, though that will probably grab the actor (e.g. Player Pawn)

Hope this helps someone else in the future.