I created a foliage system that uses a basic streaming system depending on the player position. At the moment this only works inside the game but I also want to make it work directly inside the editor (when the game is not running), therefore I need to access the position of the camera in the main viewport and use this for the streaming.
Does anyone know how to get the position of the player in the editor or the position of the camera directly?
And another question also related to editor programming stuff, is there a way to check inside an actor class whether the editor is currently in edit mode or the game is running?
This is something I’ve been looking for over the course of the last week. I just wanted to say I really appreciate that you came back to leave your answer here after finding it.
A workaround for simplier needs could be drop a cube in the level, place your camera where you want the coordinates, right-click on cube → snap object to view. Now you have the cube coordinates to copy and use on set actor location etc
Digging out an old topic, but I made a plugin that shows the camera position inside a Level Viewport. It can also set this position to a desire location
I don’t know if this is still relevant for anyone but the viewport camera is accessible in blueprint also. “Get Level Viewport Camera Info”
With that you can access the world space position and get the forward vector from the rotation.
Awesome, thanks for sharing this!
I understand there’s a learning curve as a new-ish user (3-ish years), but I keep saying it: Unreal’s biggest issue feature discoverability…
It’s still so frustrating that in 3 years of use I’m unable to find this one node when using search terms like: “camera,” “get camera,” “find camera,” “view,” “get view,” “viewport,” etc. --It’s SO frustrating.
Okay can anyone give me a step by step guide how to acces this Blueprint node? Because its not showing up for me.
I did add “UnrealEd” to my public dependency modules in the Build.cs file and rebuilt the project, but the node is still not showing up… What else do I have to do?
Is “Utility Blueprints” a plugin or something? Can you provide a link? I’ve been searching for this function node but haven’t had any luck and nothing described in this post is working, help is appreciated.
I tested this on version 4.27
Utility Blueprints are blueprints for creating tools for the editor, they are available by default. They changed in versions 5.0+, I checked, the screenshot shows the working version for 5.4.
You can get the camera coordinates in the editor if you create an Editor Utility Widget, and run it in the editor.
This should work for the Editor Utility Blueprint too, but for custom events called from other Utility Blueprints.