Hi all…
I have a C++ class where I need to try and determine the location of the currently running app. I need to build a path off this. But for some reason, this always returns and empty string.
Hi there, you should use the FPaths class, which provides various useful methods for dealing with paths. Specifically, you can use FPaths::ProjectDir() to get the directory of the project or FPaths::ProjectContentDir() to get the content directory of the project.
Thank you for your help… Oddly, I’m actually using FPaths in my project already, not sure why I didn’t think about trying to see if it would support my needs.
Guess I couldn’t see the forest through the trees.
Actually… not sure if this is going to work either… It works fine when you play in the PIE, but when I try running a package build, it’s almost as if the path got baked into the exe because the path seems to be completely wrong.
Even if I have a project build deploy with this type of folder structure.
c:\MyGame\MyGame.exe
When I do a print string on Paths::ProjectDir() I see something like this.
../../../MyGame
Which looks like it’s somehow trying to pick up the original path… SO… I searched through all the functions on this class and found
LaunchDir()
That did exactly what I needed it to do…
Basically I am home rolling my own Config file… I need to know where to go find it… For now, I just wanted it to sit in the exact same location as the game.exe…