Connect Wallets with QR Code

You can connect all WalletConnect-compatible wallets, including but not limited to Defi Wallet, Metamask, TrustWallet etc. with QR Code.

To connect with URI, please check

Connect Defi Desktop/Onchain Wallet with URI

Source Code could be copied then pasted into Blueprint Editor directly

Connect wallet via ConnectWalletConnect

Set the Connection Type of ConnectWalletConnect from PlayCppSdkActor to: Generate uri as a QR code 2D Texture

Create WBP_QR Widget

To display QR Code in Unreal Engine, we provide a 2D Texture for users to embed it into a Widget or HUD. In the following example, we will create a WBP_QR Widget for displaying the QR Code.

  1. Select Maps, right click Content Browser > User Interface > Widget Blueprint\

  2. Rename the file as WBP_QR.\

  3. Double click WBP_QR and open the Designer editor, drag Panel > Canvas Panel to viewport to create a Canvas Panel, then drag Common > Image to the canvas (named it as Image_0), update on Details tab as: 512 (Size X) x 512 (Size Y)\

  4. Click Graph and switch to Event Graph\

Event Graph of WBP_QR

  1. Right click the graph, search and select Add Custom Event..., name it as ShowQR with two inputs

    • Show: Boolean (To control the QR code show or not)

    • QR: Texture 2D (The input QR code data)

  2. We could control it to show or destroy Image 0 like below

  3. Compile > Save

Show QR Code On QRReady

Back to level blueprint editor, bind an Event to OnQRReady Delegate to show the QR to viewpoint:

Source Code

Last updated

Was this helpful?