Namely, I’ve been trying to disconnect from another scene. I am using the Moralis Wallet SDK template for authenticating via QR code. What I’ve been missing is how to use to ‘auth.Disconnect()’ function from another scene.
I have also tried directly creating a disconnect function like so:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using MoralisUnity.Kits.AuthenticationKit;
using UnityEngine.SceneManagement;
namespace MoralisUnity.Demos.Introduction
{
public class MoralisDisconnect : MonoBehaviour
{
[SerializeField]
private GameObject authenticationKitObject = null;
private AuthenticationKit authKit = null;
private void Start()
{
authKit = authenticationKitObject.GetComponent<AuthenticationKit>();
}
public void LogoutMoralisOnly(){ //for the HUB disconnect
authKit.Disconnect();
SceneManager.LoadScene(0);
Debug.Log("Disconnected Moralis wallet.");
}
}
}
I login with QR code, then in the second scene I want to click disonnect button.
Here’s an error I keep getting when clicking the button that fires this above function: