Unity + EOS: game can't detect that the game is running through Epic Game Store.

Hello, guys!

I’m trying to determine if the game was run through EGS:

string[] cmdArgs = System.Environment.GetCommandLineArgs();

bool isRunningOnEpic = cmdArgs.Any(arg => arg.Contains(“EpicPortal”));

if (isRunningOnEpic)

{

…

}

For some reason isRunningOnEpic is false. Am I doing something wrong?

I’d like to try to simulate a launch via EGS, but I don’t know if EGS can do that. Is it possible?

So far I’ve simulated a launch with my custom command line arguments and with my arguments everything worked.

I’ve submitted the game for validation, but it doesn’t pass validation because of this bug.

Yes you can test your game from the launcher, see: https://dev.epicgames.com/community/learning/knowledge-base/4VmRv/epic-online-services-how-can-i-have-a-playtest-with-my-epic-games-store-game-before-releasing-it.

I’d recommend having logging enabled in your shipping build and log the command line parameters and values passed by the launcher (I don’t know if Unity does this by default).