For every new project I open I find myself going through 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 editor that can be turned on to display current viewport camera’s xyz coordinate?
I’m not currently aware of any way to get world position of Viewport camera. It’s not an Actor, so I don’t think it can be referenced as such through Editor.
You can set Bookmarks, however. Bookmarks remember location and rotation of camera. To create a Bookmark, press Ctrl + a number 1-0. Pressing that number will return camera to that Bookmark.
You can also create a Camera in position of Viewport camera by using Viewports Options dropdown in upper-left corner and selecting Create Camera Here.
There’s some more information on Viewport Options here:
Thanks .
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 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.
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 info you need for camera position and more.
You can also GetPlayerController->GetViewTarget for some additional information, though that will probably grab actor (e.g. Player Pawn)