How to debug virtual players?

Is there any way to script debug a virtual player? I already tried to attach Visual Studio to the process Player 2 [Client] but this isn’t working.

Apologies for the late reply on this…

Yes, it’s possible to attach Visual Studio to your client processes and this is one of the great benefits of using Multiplayer Play Mode (MPPM)

From the MPPM Docs:

Unity creates a new folder within your project folder at ...[ProjectName]/Library/VP . This folder stores the data for each Virtual Player you activate. When you deactivate a Virtual Player, Unity caches its corresponding folder to use again when you re-activate it.

This is an important note as it will create a replica of your project under your Library folder, for easiest debugger attaching, you should open a Visual studio instance from within the replica folder as this will allow for auto attachment within visual studio using Debug > Attach to Unity.

Note that this will open a new visual studio instance separate from the main editor. so lasting changes should still be made in the main editor environment