Ethereum Unity3D Boilerplate Questions

Daniel,

That is a bit confusing. There is only one reference to HttpUtility.UrlEncode in the project and that is in Moralis.Web3Api.Client.ApiClient. HttpUtility is a class in System.Web so it should always be avaialble.

Can you provide a screen shot of the error and the version of Unity3D you are using, and what platform your project is set to use in Build Settings?

Thank you,

David

I found the problem, unity doesnā€™t automatically include System.Web assembly. So Iā€™ve added csc.rps file to assets with -r:System.Web.dll. And it fixed my problem.

Thanks for your quick response
Daniel

1 Like

Cool, thank you for letting me know you found an answer!

Hey there, I downloaded the project and have all the server deployed in the moralis , yet with using the trust wallet with Wallet Connect , still canā€™t validate the URI . Is there any alternative to it ? Also can is there way to do multiplayer operation in Moralis or do I need to get another multinetworking server for it ? Thanks

1 Like

Hi David, nice work with the unity 3d boilerplate!
I have a few pieces of feedback:

  • The demo is very nice, but it would be good if you could delete the ā€œexampleā€ folder when importing into a project and that folder didnā€™t contain any of the dependencies (right now it contains a bunch of dependencies for wallet connect).
  • It would also be good if there were more examples of using the API to query and fetch Moralis objects
  • In some places you put editor scripts in EditorTools folder instead of special named Editor folder - not sure why?
  • Looking forward to the WebGL implementation and improvements to WalletConnect!

I also have a suggestion of a web3 feature that would be really cool: Unity has addressables - resource bundles that can be created at build time and downloaded like DLC - it would be really cool if we could build them and push them up to IPFS in the editor, and then pull them down from IPFS at runtime. I think that would open up a lot of cool possibilities!

1 Like

Check out this page in the unity docs it might explain what is going on (with .Net Standard 2.0 vs .Net 4.7)

1 Like

The packages folder does contain some W.C. specific components. I can move this out of the example folder. The only other specific W.C. item is the WalletConnect object but this is an empty game object I created and dropped the W.C. script into.

Agreed. I am not sure if I will add these to this boilerplate or create a demo project just for that purpose. I have some rough examples I used for integration testing. May polish those up and post them, but they are not ā€œgameā€ like.

Hmmā€¦

I guess I need to fix that :slight_smile:

Me too - it is a big hill to climb. Initial try looked good, working through the update now.

I think you are refering to the project files but am not sure.

The project files themselves are auto-generated and anytime I manually update them they are re-generated. If you know of a way to have the project file generate with a TargetFrameWorkVersion other than the default please let me know. To date I have not found on online.

I did develop the SDK and API in .Net Standard2.0 and in the User Preferences this is what I set API Compatibility Level to (this is the prescribed method in the article you linked to as well).

Please continue to share any and all hints and tricks - they are helpful, and I am always learning.

Thanks,

David

You can use Moralis to create a multi-player game. Ivan did a demo to show the basics sample code. Note this demo is not Unity but the same concept can be created using the current Moralis / Unity3D SDK.

As to the Wallet issue:

  1. When you run the game do you see a QR Code?
  2. When you scan the QR Code with Trust Wallet (Settings -> WalletConnect) is a message of any type displayed?

Can you use other Wallets - yes, you can use any wallet that is compatible with Wallet Connect (though MetaMask wallet does not always respond to Wallet Connect requests).

Regards,

David

Yeah this was in regards to danda_dandicā€™s question about missing things - (the problem could be that they werenā€™t using .Net Standard 2.0)

1 Like

Hi guys, can you tell me how I can call a smart contract (that modify the contract state) from within Unity using the SDK?

Thanks.

2 Likes

Hi, thanks for asking. This is a known issue.
You can use NEthereum with Wallet Connect but only in desktop apps at there moment.

I am working with the Wallet Connect / Unity developer to create a fix that will enable this feature on all platforms.

Regards,

David

1 Like

You can use NEthereum with Wallet Connect but only in desktop apps at there moment.

Is there a doc for this specifically working with Moralis? It would help a lot.

Hello @dgoodrich & Moralis Community!

Great to connect and to learn more about opportunities within the world of Unity and Crypto. I am brand new to the Moralis community. Iā€™ve completed the 3-minute dApp project and given the https://github.com/ethereum-boilerplate/ethereum-unity-boilerplate a full review including publishing and playing with the demo.

I am an American citizen with over 20 years of game development experience. Iā€™m shifting my own passions and experience toward the crypto side of gaming and found your company.

Unity is a rich toolset that is (deservedly) outside of the main crypto tooling pipelines and that is a missed opportunity as crypto+gaming continues its rapid ascent in popularity. Glad to see Moralis leading the way.

Kudos on the great work!

Iā€™ll certainly have more questions and feedback soon.

Some suggestions for the GIT Readme

  • Add instructions for the gameplay. Itā€™s not clear what is and isnā€™t to be expected when hitting the Unity play button
  • Add some context regarding authorization. The docs make many assumptions in general, and thatā€™s ok since its early days, but auth is low-hanging fruit for answering common questions. Something simple is ok for now (e.g. Go get an app (link), do free signup (link), then point the phone at the screen to login).

Thanks again!

-Sam Rivello
Unity Game Development Instructor

Resume | Teaching Portfolio: SamuelAsherRivello.com/contact/

2 Likes

@SamR,

Thank you for the comments. I do plan on creating some more complex examples to showcase more of the Moralis SDK.

Regards,

David

1 Like

Hello Moralis Community!

Having fun with Unity+Crypto including Moralis and working my way through creating robust custom demos. More details to come! https://github.com/SamuelAsherRivello/Intro_To_Unity_Crypto/

2 Likes

Cool - are these live already?

Hi David,
Was just looking to try out the latest changes with the addition of support for webgl but it seems like there are some compile issuesā€¦ maybe the api folder is missing in ā€œAssets/MoralisWeb3ApiSdk/Moralis/Moralis.WebGL/Moralis.Web3Apiā€? (there is a meta file but no folder)

1 Like

Hi. we want to make a game with Unity and integrate with blockchain.

1: in your Youtube channel i just saw 1 video about Unity, did you have a full SDK or API for unity as well as React or other languages?
2: You have a server. What happens when the server shuts down ? so in this case our Dapp is not Dapp! and doesnā€™t work. Right?
3: if you support Unity, what Version is good for working with metamask or other wallets in a game? For example Mobile version or OpenGL version?

1 Like

Hi, justed wanted to ask if Cloud Code support is available via this package.
If not, Iā€™d like to know how to deploy some code to Moralis Cloud since our requirement hinges on it.

1 Like