Comment on page
Frequently asked questions about ChainSafe Gaming's SDK, web3.unity.
- 1.Common Questions
- 2.Common Questions About Upgrading To The Latest Version of web3.unity
- 3.Common Error Messages
Yes, the SDK is free to use.
Yes, you can make desktop, web, and mobile games using our SDK. To create a desktop game with web3.unity, you will need to create a Web3GL build with web3.unity.
Yes. The SDK will support other EVM-compatible chains.
You will need to edit the
network.jsfile found within the WebTemplates folder. Edit the
ChainIdto the one for the blockchain you want your game to interact with. See websites like Chainlist for a list of EVM ChainID's. You will then also need to an appropriate RPC endpoint for the chain you wish to connect with.
Not currently. Although, the SDK is mainly compatible with Ethereum Virtual Machine (EVM) blockchains, we do have plans for supporting non-EVM chains in the future depending on community support.
Answer #1: This usually happens because the game has not informed the user that a MetaMask pop up will occur. You can solve this by adding a simple notification as seen below.
Answer #2: Some stores may require a demo version of the game so that the stores teams can review the product without needing an external wallet. You can simply add a demo button within the game that takes the user to a free-to-play version of your game without blockchain calls to test. This should be enough for the store to accept your games application. Happy coding!
web3.unity is currently on v2.
- Improves reliability - This upgrade gives developers the flexibility to choose the best infrastructure for their use case and avoid possible downtime while also choosing fallback options if any infra provider fails.
- Improves scalability - Game studios will be able to pick and choose the infrastructure that serves their uptime requirements.
- Improves SDK speed - Removing the API server speeds up the blockchain gaming UX since reads and writes can happen either player-side or on dedicated infrastructure.
- Improves transaction handling - Improved event listening (getting a notification immediately when a transaction goes through, rather than pinging the API server repeatedly for a status update) is one of the most consistently requested features. Decentralizing provides more responsive event handling by allowing devs and players to check transactions directly.
- Improves collaboration - Open sourcing v2 invites the gaming community to contribute meaningfully to the codebase — helping to debug, optimize, and ultimately, determine for themselves where it may be undesirable or infeasible for service providers to run infrastructure.
The latest version (v2) will require code changes for games using legacy versions of web3.unity (v1.6.x or lower).
Some effort will be required to refactor games that use modified versions of our prefabs, as well as needing to configure an RPC provider for broadcasting transactions to the various networks we support. Without these changes, games will be impacted and players will no longer be able to make and sign transactions.
This largely depends on the amount of affected code you have in your game and the platform that you’re building on; both our team and the community are here to help.
- 2.Sign up for a node provider and get an RPC endpoint (if you aren’t already using one). More on this below.
- 3.Update any code in your game that uses modified versions of our prefabs
- 4.Test your game to ensure all functions work the same way as before
Without these changes, people will be unable to make transactions from within existing games. This will require some effort to refactor code based on legacy versions. Users can expect payoffs in the longer term, and we’re here to help make the transition as smooth as possible.
The latest decentralized version of the SDK will significantly reduce the involvement our intermediary API servers play which previously was causing developers with intermittent outages and bottlenecks. Instead, we are encouraging users to assess and determine the uptime guarantees needed from infrastructure providers in supplying an RPC node.
The aim is to move away from supporting the API service once the community has had adequate time to upgrade to the latest version.
The sunset date for the API is slated for May, 2023.
While we appreciate and understand how this may impact some of our existing developers and their games/communities, an upgrade to the latest version is required.
We believe the net positive as a result of ultimate developer control, transparency, and decentralization makes upgrading to the latest version a worthwhile endeavor in the long run.
Yes, the SDK will remain free to use.
IPFS has its own protocol that isn't supported in JSON.Net. In order to get around this, you will need to add something like the following code snippet:
string imageUri = data.image;
imageUri = imageUri.Replace("ipfs://", "https://ipfs.io/ipfs/");
C#// Some code
This error typically happens when the user hasn't selected the Web3GL template for making WebGL Games. Make sure you have selected the provided template before making a Web3GL-based game.
You need to add the web3 component into your react build manually. To do so:
- 1.In your public folder, add the web3 folder from a unity build.
- 2.Then import the following as a script at index.html.
\<script src="%PUBLIC\_URL%/YourGame/web3/index.js">\</script> \<script src="%PUBLIC\_URL%/YourGame/web3/lib/web3modal.js">\</script> \<script src="%PUBLIC\_URL%/YourGame/web3/lib/web3.min.js">\</script> \<script src="%PUBLIC\_URL%/YourGame/network.js">\</script>
This should solve your issue. Happy coding!