Skip to content

thirdweb-dev/unity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Thirdweb Unity SDK

Unity Documentation .NET Documentation

Technical Demo

Experience our multichain game demo leveraging In-App Wallets and Account Abstraction built in three weeks - Web3 Warriors.

image

Supported Platforms & Wallets

Build games for WebGL, Desktop, and Mobile using 1000+ supported chains, with various login options!

Wallet Provider WebGL Desktop Mobile
In-App Wallet (Email, Phone, Socials, Custom) ✔️ ✔️ ✔️
Ecosystem Wallet (IAW w/ partner permissions) ✔️ ✔️ ✔️
Private Key Wallet (Guest Mode) ✔️ ✔️ ✔️
Wallet Connect Wallet (400+ Wallets) ✔️ ✔️ ✔️
MetaMask Wallet (Browser Extension) ✔️
Smart Wallet (Account Abstraction) ✔️ ✔️ ✔️

✔️ Supported   ❌ Not Supported   — Not Applicable

Getting Started

  1. Download: Head over to the releases page and download the latest .unitypackage file.
  2. Explore: Try out Scene_Playground to explore functionality and get onboarded.
  3. Learn: Explore the Unity v5 SDK Docs and the .NET SDK Docs to find a full API reference.

Notes:

  • Tested on Unity 2021.3+, 2022.3+, Unity 6 Preview. We recommend using 2022 LTS.
  • Newtonsoft and EDM4U are included utilities; deselect if already installed to avoid conflicts.
  • If using .NET Framework and encountering HttpUtility errors, create csc.rsp with -r:System.Web.dll under Assets.
  • Use version control and test removing duplicate DLLs if conflicts arise.
  • To use your own WalletConnect Project ID, edit Assets/Thirdweb/Plugins/WalletConnectUnity/Resources/WalletConnectProjectConfig.asset.

Build Instructions

General

  • Build Settings: Use Smaller (faster) Builds / Shorter Build Time.
  • Player Settings: Use IL2CPP over Mono when available.
  • Stripping Level: Set Managed Stripping Level to Minimal (Player Settings > Other Settings > Optimization). (Generally not a hard requirement unless using WalletConnect as a wallet provider option.)
  • Strip Engine Code: Make sure this is turned off.

WebGL

  • WebGL Template: None enforced, feel free to customize!
  • Compression Format: Set to Disabled (Player Settings > Publishing Settings) for final builds.
  • Testing WebGL Social Login Locally: Host the build or run it locally with Cross-Origin-Opener-Policy set to same-origin-allow-popups.

Example setup for testing In-App or Ecosystem Wallet Social Login locally (no longer required with Unity 6 Web, can use Build & Run):

// YourWebGLOutputFolder/server.js
const express = require("express");
const app = express();
const port = 8000;

app.use((req, res, next) => {
  res.header("Cross-Origin-Opener-Policy", "same-origin-allow-popups");
  next();
});

app.use(express.static("."));
app.listen(port, () =>
  console.log(`Server running on http://localhost:${port}`)
);

// run it with `node server.js`

No action needed for hosted builds.

Mobile

  • EDM4U: Comes with the package, resolves dependencies at runtime. Use Force Resolve from Assets > External Dependency Manager > Android Resolver.
  • Redirect Schemes: Set custom schemes matching your bundle ID in Plugins/AndroidManifest.xml or equivalent to ensure OAuth redirects.

Migration from v4

See https://portal.thirdweb.com/unity/v5/migration-guide

Need Help?

For any questions or support, visit our Support Portal.

Thank you for trying out the Thirdweb Unity SDK!