Connect Unity to Metaverse


How do I get to connect Unity to a meta app

Hi @shriya.c, If your question is related to self-hosted server then please check this post for the steps that need to be followed in the unity.

Please provide more details if that does not resolve your issue.

I did try following this https://www.youtube.com/watch?v=l2qTyc-V9cM
but it does not work
I need to make a dApp using Unity and Moralis which uses a self-hosted server

Unity requires some additional steps. Those were not shown in the video.

The post which I shared in the previous message will help solving the errors.

I have followed this step,

IDictionary<string, object> requestMessageParams = new Dictionary<string, object>();

requestMessageParams.Add(“address”, address);
requestMessageParams.Add(“chain”, session.ChainId);
requestMessageParams.Add(“network”, “evm”);

Dictionary<string, object> authMessage = await Moralis.Cloud.RunAsync<Dictionary<string, object>>(“requestMessage”, requestMessageParams);

signMessage = authMessage[“message”].ToString();

But it gives me this error:
Packages\io.moralis.web3-unity-sdk\Runtime\Kits\AuthenticationKit\Scripts\AuthenticationKit.cs(277,47): error CS0103: The name ‘session’ does not exist in the current context

Also where exactly do we edit ‘getServerTime’ because it is on line 262 here,

Which version of the Unity game kit are you using? Your code looks different from the latest AuthenticationKit.cs. You may need to adjust the changes differently.

session should be coming from this line.

You can edit it there in case it’s on a different line.

If possible you can start with a new project with the latest Moralis game kit version.

I did download the latest and redid the whole thing, but now i get this while signing into MetaMask

Hi @shriya.c, Can you show the file or line that is connected to the error which you see in the console?

and did you get the message in your app for signature?