I think I have a solution for this however I used code from the ânft-Shopâ example project, i need to test it today but Iâll post it all here to help anyone out
so I have now got a working unity project that display all nfts owned by a user for a specific contract.
I simply imported the âplayer inventoryâ script from the ânft-shopâ project and set everything else up the same way the sample project is, call the load items function, and now I have a viewport that populates itself with all the nfts from my contract,
I suppose its still not quite answering the original question of âdisplaying all nftsâ but its a good step for me,
edit: not currently working in webGL using Firefox, does not load the images
edit 02: working in webGL in Chrome
@tseabrook can you share this project with meâŚso that I can see the codes and know where I was wrong.
sure thing, Iâll share it later today
Youâre the life saverâŚplease do share so that I know my mistakes as well as ask you for any further doubts. Thanks a ton man!!!
Heres a quick guide on what I did, sorry I dont really have time to go more in-depth right now but it shows the main steps;
And heres a download link to the project;
I would assume you will have to update the contract address and abi before you get any results as its contract specific for now and obviously im using one of my own test contracts.
I would be really interested to know if and how you manage to develop this as its still not fullfilling all the functionality I want, namely displaying all nfts owned by an address
Still not working and this is why I am asking help, @dpradell please help if possible.
@tseabrook not working when I connect with my wallet.
did you also deploy a smart contract, add an nft and replace the 2 fields in the game manager?
@tseabrook I replaced the fields in Game Manager but have not deployed any smart contract, my whole point is to build a game where player login with their metamask, then all nft present in any chain they logged in with should be displayed on panel. I mean any player from anywhere, so why do I need smart contract or ipfs fileâŚI want to fetch nft present in wallet and then display them on panel. I hope I am clear now.
Yes thats one of the things Im trying to acheive but this is as far as Ive got so far,
The reason it needs a contract for now is because of this function âGetNFTsForContractâ, which is from the shop tutorail
there should be a function named getNFTs that should get all the nfts for an address
thankyou , that was my next thing to take a look at later today
Yes, thatâs the main problem for me tooâŚI have to build a place where people from anywhere can login and check nfts present in their wallet on my panel, so I donât want any specific chain or address. This is the main reason I ask for help, as in shop tutorial you can only show nfts from ipfs file, which were there.
so the âgetNFTsâ is working for me, by changing this line in the playerinventory script like so;
@cryptokid if you know how exactly to get from the method and then show it on panel in unity please help. As I am not able to do soâŚ
can you tell me what to replace the url of ipfs file with if I want to download nfts texture from wallet @tseabrook
I donât know how to display them in unity, getNFTs should get you all the nfts for an address and a chain