Adding Metamask to your Unity WebGl Blockchain Game

  Рет қаралды 15,476

FusedVR

FusedVR

Күн бұрын

Metamask is one of the most popular wallets that is used to interact with the Ethereum Blockchain. And so from a practical standpoint, it makes sense to leverage Metamask as our wallet of choice to send and sign transactions for games built using Unity. In this tutorial, we will take a look at how to integrate Metamask with a Unity WebGL application in order to send messages from C# to Javascript so that we can interact with Javascript and Metamask or in other words window.ethereum.
Discord : / discord
Relevant Links :
1. WebXR Metamask Github Repo : github.com/FusedVR/WebXR-ETH
2. NEthereum : github.com/Nethereum/Nethereum
3. Unity Sample : github.com/Nethereum/Unity3dS...
4. MetaMask : metamask.io/
Chapters:
0:00 Metamask Demo
1:49 Github Open Source
3:06 Unity Project Structure
3:42 Smart Contract
4:24 WebGL Build Settings
5:05 WebGL Index Page
6:05 Metamask Javascript
7:32 Metamask Functions
10;37 Next Steps
Some Affiliate Links that help support the channel :
Order Oculus Quest 2 ; amzn.to/2G3NwXq
Check out our book on Amazon : amzn.to/2lmry7H
Leap Motion : amzn.to/2VDTcur
Looking to get into VR? Try Oculus Quest : amzn.to/2otkjfe
Or for PC VR try Vive Cosmos: amzn.to/2ILa6lo
Google Cloud Referral Link: gcpsignup.page.link/F1Fi
Want to Donate?
Bitcoin Address : 3QzAxbMBVr9nrq64AtcwjUoBqVgyjyHQcR
Ethereum Address : 0xB2B92DDAC0c8D976ee22Daf58Ff67AeBD194dE0d
----------------------------------------------------------------------------------
Welcome to FusedVR! These videos/streams are a chance not only for anyone to learn more about AR/VR development, but also a chance for anyone to ask questions about LITERALLY anything! Whether it be about your own AR/VR development, your future projects, or just AR/VR in general, we would love to talk with you about it!
Interested in keeping up to date with the channel? Follow us on social media or subscribe to the channel!
Twitter : / fusedvr
Subscribe on KZbin : bit.ly/1SZXwtn
#eth #unity #blockchain

Пікірлер: 70
@SarkisianNile
@SarkisianNile 3 жыл бұрын
Thank you so much for these
@FusedVR
@FusedVR 3 жыл бұрын
More to come :-)
@SarkisianNile
@SarkisianNile 3 жыл бұрын
@@FusedVR I'm trying to load WebGL player for Unity 2020+ with Web3, but it seems its changed for streamlined loading. Let me know if you have any tips.
@FusedVR
@FusedVR 3 жыл бұрын
@@SarkisianNile so my understanding is all the web3 APIs are deprecated and have basically been replaced with etheruem apis like this docs.metamask.io/guide/ethereum-provider.html#table-of-contents
@SarkisianNile
@SarkisianNile 3 жыл бұрын
@@FusedVR TY Fuseman, lemme c if I can't whoop something up. Will post my results.
@SarkisianNile
@SarkisianNile 3 жыл бұрын
Got it to go in 2020+ by changing the .Net settings in Unity. Now I'm looking into connecting to Metamask in game - which seems maybe Metamask's preferred way (?)
@danielesuppo8083
@danielesuppo8083 2 жыл бұрын
Hello! Great tutorial! What if I publish my game, and someone does not use Metamask but some other wallet? Should I implement the API for all the possible wallets in the js file, and ask at start which wallet they want to use??
@danielesuppo8083
@danielesuppo8083 2 жыл бұрын
Many thanks! How can I modify to Mint function (on Remix) to accept a receiver address parameter? Actually it just send tokens to me (msg.sender)
@isaquecrazy
@isaquecrazy 2 жыл бұрын
Flapyp have error: Assets\Scripts\ScoreContractService.cs(99,6): error CS0246: The type or namespace name 'Parameter' could not be found (are you missing a using directive or an assembly reference?)
@tyebeach
@tyebeach 3 жыл бұрын
Thank you for these videos! I want to create a game and make sure that the player has my token in their wallet. I have metamask working I just don't know how to check to see if there is a certain amount of my token in their wallet. Could you possibly help me with this?
@FusedVR
@FusedVR 3 жыл бұрын
i would take a look at something like this ; docs.metamask.io/guide/rpc-api.html#other-rpc-methods im still doing more research myself into smart contract integration and best practices, but hopefully that is a start
@tyebeach
@tyebeach 3 жыл бұрын
@@FusedVR Awesome, thank you!
@kenmarold6029
@kenmarold6029 2 жыл бұрын
Can this work on Metamask using the Polygon blockchain instead of Ethereum?
@FusedVR
@FusedVR 2 жыл бұрын
I believe so just requires switching to the Polygon network in Metamask
@androck9794
@androck9794 2 жыл бұрын
where i can learn to do this by myself? any course?, i want to know how to connect metamask with unity to make NFTs..
@FusedVR
@FusedVR 2 жыл бұрын
im really only aware of a few blog posts I have seen while Googling and my videos. if you have any specific questions, feel free to ask over on our discord
@Rabbit14
@Rabbit14 Жыл бұрын
How would I go about adding metamask in unity that would just confirm you hold a certain erc20 and then allows you into the game?!
@FusedVR
@FusedVR Жыл бұрын
check out Chain Auth, which allows for this
@Rabbit14
@Rabbit14 Жыл бұрын
@@FusedVR thanks, does it also work for unreal?
@FusedVR
@FusedVR Жыл бұрын
@@Rabbit14 no sdk at the moment, but all the apis can be called from Unreal yes
@damsan7777
@damsan7777 2 жыл бұрын
I wana see when the players open the box. And then are 3 diferent NFTs there. Is this posible?
@FusedVR
@FusedVR 2 жыл бұрын
recently put up some NFT videos on a similar topic
@jhhuh3374
@jhhuh3374 3 жыл бұрын
this is for WebGl, but what about other platform? do one need a built-in wallet in the application to connect to a blockchain?
@FusedVR
@FusedVR 3 жыл бұрын
take a look at our previous video : kzbin.info/www/bejne/hnvaemabo52kbZo you can implement it for other platforms provided you have a means to get a private key
@jhhuh3374
@jhhuh3374 3 жыл бұрын
@@FusedVR i dont think ppl would be too much happy about giving away their private keys though, i can only think about: making address for any player on server side and give access from client to the address
@jhhuh3374
@jhhuh3374 3 жыл бұрын
@@FusedVR never-mind actually just making a sort of in-built wallet on client side could be ok, do you know any discord for unity+blockchain development?
@awuchen2718
@awuchen2718 3 жыл бұрын
@@FusedVR is there anyway to have metamask integration in iOS? or can this only be done through webGL?
@Blutch4444
@Blutch4444 2 жыл бұрын
How would someone go about making a unity game on polygon? Since ETH gas is too high
@FusedVR
@FusedVR 2 жыл бұрын
exact same way except you would deploy contracts to polygon
@Niknikolaou00
@Niknikolaou00 3 жыл бұрын
As i undestand i have to use private keys inside unity? Or not need?
@FusedVR
@FusedVR 3 жыл бұрын
with metamask, no need. Metamask will be responsible for signing with the private key
@Niknikolaou00
@Niknikolaou00 3 жыл бұрын
@@FusedVR Thanks Bro Great videos. I will check your Github Repo
@mrprogress7236
@mrprogress7236 3 жыл бұрын
Hi! Thanks for the video! Is it possible to connect windows build with metamask?
@FusedVR
@FusedVR 3 жыл бұрын
i guess technically it may be possible, but that would basically mean having windows up a browser to run metamask for you as i dont think there is a windows build of metamask
@mrprogress7236
@mrprogress7236 3 жыл бұрын
@@FusedVR true, we are already working on it, i will update you ones ready :))
@mrprogress7236
@mrprogress7236 3 жыл бұрын
@@FusedVR the most tricky stuff is a build ux friendly bridge between site and windows build
@subhradeepc9513
@subhradeepc9513 2 жыл бұрын
@@mrprogress7236 Did you happen to achieve any success with the Desktop wallet scenario ?
@ZX6R_SQUID
@ZX6R_SQUID 2 жыл бұрын
These videos are great. Are you able to make a video on a NFT contract that triggers using collider? So say you pickup an item it will mint a NFT of said item? That would be great. I have been trying for months and just can't get it.
@FusedVR
@FusedVR 2 жыл бұрын
starting this weekend, will be doing ERC 20 and then shortly after plan to look at NFTs
@ZX6R_SQUID
@ZX6R_SQUID 2 жыл бұрын
@@FusedVR Awesome collecting ERC20 using colliders? that would be amazing.
@ZX6R_SQUID
@ZX6R_SQUID 2 жыл бұрын
@@FusedVR Also your tutorials are dope bro.
@FusedVR
@FusedVR 2 жыл бұрын
@@ZX6R_SQUID just ERC 20, but could of course run the same code on a collider event
@diosito_dev
@diosito_dev 2 жыл бұрын
this work with binance smart chain ?
@FusedVR
@FusedVR 2 жыл бұрын
yup
@vfxninja1156
@vfxninja1156 3 жыл бұрын
I'm looking to create a game in Unity, where players can collect crytocurrency tokens and NFT tokens. Is this possible as I can not find any tutorials or resource's online? Great vid by the way FusedVR
@FusedVR
@FusedVR 3 жыл бұрын
definitely possible and is on my list of things to check out, just might be sometime till i get around to it
@The-Sentinel
@The-Sentinel 2 жыл бұрын
great video. what about allowing access to a specific part of a game if the user holds an NFT or certain erc type token? like, sign your wallet to verify and get teleported to a members area of a game.
@FusedVR
@FusedVR 2 жыл бұрын
pretty close to something similar i plan to make a video on in the future - enabling access to a game only if you own the NFT.
@hvillacruz
@hvillacruz 3 жыл бұрын
can use this for BSC?
@FusedVR
@FusedVR 3 жыл бұрын
have not tested this, but from my understanding BSC is compatible with Metamask so should be possible
@priyanshusahu8024
@priyanshusahu8024 2 жыл бұрын
Is there anything like this in unreal Engine ?
@FusedVR
@FusedVR 2 жыл бұрын
as far as webxr exporters go, not sure
@cryptoworldgames
@cryptoworldgames 2 жыл бұрын
can you help me use metamask (binance smart chain network) on a browser unity game, or a pc unity game please?!!! i'll pay you to help
@FusedVR
@FusedVR 2 жыл бұрын
feel free to reach out on discord and we can chat
@bizkit.
@bizkit. 2 жыл бұрын
is there a way to connect to another custom EVM?
@FusedVR
@FusedVR 2 жыл бұрын
same tutorial works if you add binance or polygon to metamask
@bizkit.
@bizkit. 2 жыл бұрын
@@FusedVR you're the best, thanks!
@shinronitgaming486
@shinronitgaming486 2 жыл бұрын
Is it possible to do this with windows build?
@FusedVR
@FusedVR 2 жыл бұрын
not sure there is an easy way to do this and I think would require a server in the middle to handle the auth.
@shinronitgaming486
@shinronitgaming486 2 жыл бұрын
@@FusedVR we have a server can you make a video on it?
@shinronitgaming486
@shinronitgaming486 2 жыл бұрын
@@FusedVR also can you upload a video of phantom and unity wallet integration? That would be really helpful.
@FusedVR
@FusedVR 2 жыл бұрын
@@shinronitgaming486 will need to think about the best way to handle that but yeah I;ll keep it in mind
@sarahwonkim6046
@sarahwonkim6046 2 жыл бұрын
how do u add json files
@FusedVR
@FusedVR 2 жыл бұрын
in what regard?
@sarahhhkimmm
@sarahhhkimmm 2 жыл бұрын
@@FusedVR I was having trouble adding json files to unity because it will only do c#
@FusedVR
@FusedVR 2 жыл бұрын
@@sarahhhkimmm I recommend this package : com.unity.nuget.newtonsoft-json Works a lot better than the default JSON in C#
@dreamscheme3862
@dreamscheme3862 3 жыл бұрын
too bad webgpu is years away and webxr isn't enough. No compute shaders, poor performance. It's a shame...
@FusedVR
@FusedVR 3 жыл бұрын
true. to be honest, I am more interested in web from a streaming standpoint for cloud gaming or cloudxr
Scary Teacher 3D Nick Troll Squid Game in Brush Teeth White or Black Challenge #shorts
00:47
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 13 МЛН
5 Things to Know w/ NGO - Unity Devs (Lobby Relay WebGL)
4:56
Jason Weimann
Рет қаралды 7 М.
Run your own AI (but private)
22:13
NetworkChuck
Рет қаралды 1,2 МЛН
You've been using AI Wrong
30:58
NetworkChuck
Рет қаралды 436 М.
How To Become A Blockchain Developer In 2023?
18:05
EatTheBlocks
Рет қаралды 135 М.
What are AI Agents?
12:29
IBM Technology
Рет қаралды 58 М.
How to connect Smart Contracts to Unity Games with Chainsafe SDK
13:12
What is Blockchain
13:58
zlotolow
Рет қаралды 3,2 МЛН
Как распознать поддельный iPhone
0:44
PEREKUPILO
Рет қаралды 2 МЛН
Cheapest gaming phone? 🤭 #miniphone #smartphone #iphone #fy
0:19
Pockify™
Рет қаралды 4,1 МЛН
САМЫЙ ДОРОГОЙ ЧЕХОЛ! В стиле Mac Pro
0:35