juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.09k stars 505 forks source link

postMessage function not working, created a Counter app in unity and flutter #875

Closed zubair999 closed 9 months ago

zubair999 commented 10 months ago

Describe the bug I successfully integrated unity into flutter but now stuck in establishing communication between flutter and unity back and forth. In unity I have created a counter app and in flutter when I increased counter value the count value don't increase or decrease in unity. What setting or code in flutter or unity side I need to change to make it work.

Basically I want to send json data to Unity App later on. So please help on that too.

Expected behavior As counter value increase in flutter we should see count value in unity.

Screenshots

https://github.com/juicycleff/flutter-unity-view-widget/assets/30196482/30ea4f20-0457-46ff-a418-879a0c72ad09

**Flutter Version Flutter 3.10.6 • channel stable • https://github.com/flutter/flutter.git Framework • revision f468f3366c (8 weeks ago) • 2023-07-12 15:19:05 -0700 Engine • revision cdbeda788a Tools • Dart 3.0.6 • DevTools 2.23.1

Unity (please complete the following information):

Smartphone (please complete the following information):

Additional context My flutter postMessage function code

void setRotationSpeed(String speed) { _unityWidgetController.postMessage( 'Cube', 'SetRotationSpeed', speed, ); }

altafc22 commented 1 day ago

Hi @zubair999, i'm facing same issue, could you please share how did you solved it ?