Hey, i’m wondering what I did wrong here. I need to check if a user has a certain NFT, but this doesn’t seem to work.
MoralisUnity.Platform.Objects.MoralisUser moralisUser = await Moralis.GetUserAsync();
Debug.Log(moralisUser.ethAddress);
NftOwnerCollection NFTs = await Moralis.Web3Api.Account.GetNFTs(moralisUser.ethAddress.ToLower(), ChainList.eth);
Debug.Log(NFTs.ToJson());
bool good = false;
for (int tokenId = 0; tokenId < NFTs.Total; tokenId++) {
Debug.Log(NFTs.Result[tokenId].TokenAddress);
if (NFTs.Result[tokenId].TokenAddress == "0xe3F4E587908F1E4b74DFe49F7643303a60B2E9E3") {
good = true;
break;
}
}
if (good)
authKit.SetActive(false);
else
notOwnedText.SetActive(true);
Thank you for your help.