Steps to reproduce:
1. Open the attached project "P4Test.zip"
2. Make sure to the Version Control settings the perforce fields are empty and the VCSMode set as Visible Metafiles
3. Close the project
4. Open CMD/Terminal
5. Enter the following command (modified with relevant changes):
"C:\Program Files\Unity\Hub\Editor\6000.0.37f1\Editor\Unity.exe" -batchmode -projectPath "C:\Your\Perforce\Project\Path" -executeMethod VCSModeSample.RunTest -quit -vcsModeSession Perforce -vcPerforceUsername your_username -vcPerforcePassword your_password -vcPerforceWorkspace your_workspace -vcPerforceServer ssl:your_perforce_server:port
6. Look for [VCSModeSample] lines in the Editor.log file
Expected Results: "[VCSModeSample] Provider enabled? True isActive? True OnlineState: Online" is returned in the Editor Log
Actual Results: "[VCSModeSample] Provider enabled? True isActive? False OnlineState: Offline" is returned and connection is not established
Reproducible with: 2021.3.52f1, 2022.3.62f1, 6000.0.49f1, 6000.1.4f1, 6000.2.0b3, 6000.3.0a1
Environment tested: Windows 11 24H2
Notes:
-The connection only becomes active and online when a workaround (Provider.UpdateSettings.Wait()) is used within a script executed by the Unity editor. This behavior deviates from expected results and is inconsistent with the documentation, which suggests that CLI parameters alone should fully establish the connection automatically