Display all NFTs In Unity

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

1 Like

@tseabrook thanks alot, I will look at it and try what I can do possibly

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…

let me try brother…just wait a bit @tseabrook

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

okay thank you so much @cryptokid