Unity & Smart Contracts - Helping each other

Lets use this thread to support each other with questions regarding the Unity & Smart Contracts Project :star_struck:

Read instructions: Coming soon

Feel free to ask for help here - but also ensure YOU HELP people that are asking questions you know the answers to

The Moralis staff and community managers will be keeping an eye on this too :star_struck:

Hello, Im having a long delay between transaction confirmation and the Unity listener picking up a Mumbai testnet event, Is there a specific block confirmation number needed for Moralis to acknowledge a transaction as confirmed?

How long is the delay typically? Can you post your code?

About 10 minutes. I am using one of the youtube tutorials:

I notice that the event has a confirmed column in the database and I wont get an update on the event in unity until that value is set to true in the DB. However, not sure what the condition is for that attribute to be set.

Hoping to leverage the event functionality for my game but 10 minutes on polygon is far too slow.

Hi @leolegend, welcome to the discussion.

Is this happening with the build on WebGL? Or when testing in the Editor?

Thanks!

Webgl build running in chrome

@dpradell
Webgl build running in chrome

[quote=ā€œdpradell, post:5, topic:15244ā€]
r w
[/quote]i

Hi leolegend - The app works great for me without delay in the Unity Editor on my PC and running in WebGL using Chrome, but I do get the 10-12 minute delay when running on my Android phone(s). And then, when the delay is over, the MoriaGates app forcibly closes by itself. :slightly_frowning_face: @dpradell, Do you have an idea of what could be causing this or where in the code I might look to try and debug this?

Hi @leolegend, I tested it on Editor, PC and WebGL and never waited more than 20 seconds so I couldnā€™t reproduce your issue. I assume youā€™re using MetaMask with Mumbai testnet imported?

Hi @kendev I didnā€™t tested it on Android so I have no idea at the moment what could be causing the issue. Not in front of computer right now but try debugging AppManager, where we listen the OnUpdateEvent from the query

Ok thanks - will take a look at that and let you know if I find anything!

Hi @dpradell - running in the PC environment on my computer, sometimes the app waits for 10-12 minutes before it displays the results, and sometimes itā€™s just a few seconds. On my Android phones, the delay is always 10-12 minutes before the app crashes. I was able to get a log on the Android phone and itā€™s available here: https://www.codepile.net/pile/vPDXWzPy perhaps you can spot something from these logs?

Hi @kendev, thanks for the testing and the log. I will test this myself and get back to you.

Hi @dpradell - did you get a chance to look into the problem on Android? I have several clients that want to see a working demonstration of both read and write smart contract access running in Android and using the Unity Web SDK. Does this exist elswhere, and with the latest web3-unity-sdk? Thanks.

Hi @kendev

Iā€™ve been a bit busy with next project which will be AR based, built to Android. The project itself doesnā€™t include event listening but I will test it on that project after I release the video. This week I will let you guys know how that goes.

Cheers

Awesome @dpradell, and thanks very much for your time and support. I have several AR projects and prototypes running under Android including using the Nreal Light AR Smartglasses so this is wonderful news to me - Go Moralis!!!

Hi everyone. Iā€™ve updated the the sample project to SDK 1.2.2 version. This is the repo now where I will be updating the project from now on.

And @kendev I could not replicate the issue but weā€™ll be looking at the behaviour of contract syncing soon so Iā€™ll come back to you at some point.

Cheers everyone!

@drpadell
My troubleshooting attempts led me to clues that the Application.Quit() method was being called after the consistent 10-12 minute delay response time. So itā€™s possible that this is being called by a timeout of one of the SDK await methods involved during the contract syncing process? Anyway, good luckā€¦

Hey @kendev thanks for your info and your interest. Weā€™ve been re-thinking what services weā€™re offering in the near future and contract syncing will be different; you wonā€™t need the database to create the table, add the abi, etc. It will be much more efficient and easy. I donā€™t have an specific date for it but I know the team is fully concentrated on this.

Iā€™ll keep up to date you guys in this forum thread :slight_smile:

Cheers!

Hi @dpradell - thanks for this update and for all your fabulous work - good luck with the services upgrade and looking forward to your next update!

Go Moralis!!!

1 Like