Transferring matchmakermatched between scenes

I want to find a match in one scene, use the matchmaker properties to choose which scene I should load, then actually join the match in the next scene. Are there any examples or best practices for joining a match from a different scene than the one where you matchmake?

Thanks in advance.

Hey @GTG101 great question. There are many different ways of transferring state between scenes in Unity, none of which are perfect, frankly.

My preference is to store cross-scene state in a ScriptableObject. So you connect in one scene, receive your Match object, assign it to the ScriptableObject, and reference it in the next scene. There’s an example of this exact situation in our example project which you can find here: https://github.com/heroiclabs/unity-sampleproject/blob/master/PiratePanic/Assets/PiratePanic/Scripts/GameConnection.cs#L90

Thanks, I appreciate the quick response and I appreciate you being upfront with me about it not being perfect. The good news is that transferring a match between scenes using scriptable objects is a perfect solution for me since it requires a minimal amount of work on my part.