I have a simple project with a scene that I can run through the Unity app. I am now trying to take and save a simple screenshot in batchmode, but to no avail.
Here is the code I use:
using System.Collections.Generic;
using UnityEngine;
using System.IO;
public class TakeAShot: MonoBehaviour
{
public static void MyGameMethod()
{
string imagePath = "Assets/Resources/test.png";
ScreenCapture.CaptureScreenshot(imagePath);
}
}```
Here is the command I am running:
```/Applications/Unity/Hub/Editor/2019.4.3f1/Unity.app/Contents/MacOS/Unity -batchmode -projectPath /Users/mikemike/MyFirstGame -executeMethod TakeAShot.MyGameMethod -quit```
The command does not error out, but no screenshot is being saved.
Thanks in advance for your help