flutter-unity-view-widget icon indicating copy to clipboard operation
flutter-unity-view-widget copied to clipboard

Unity Widget is not working in Web platform

Open AliShehab93 opened this issue 3 years ago • 4 comments

Hi, When running the project in chrome, it is not showing any error, just printing this:

Performing hot restart... Waiting for connection from debug service on Chrome... Restarted application in 139ms. Height of Platform View type: [_iframe_5ac1bdfa_d970_488e_938d_42c44b76522a] may not be set. Defaulting to height: 100%. Set style.height to any appropriate value to stop this message. Width of Platform View type: [_iframe_5ac1bdfa_d970_488e_938d_42c44b76522a] may not be set. Defaulting to width: 100%. Set style.width to any appropriate value to stop this message. [log] ********************************************* [log] ** flutter unity controller setup complete ** [log] ********************************************* crbug/1173575, non-JS module files deprecated.

Any updates?

AliShehab93 avatar Jun 28 '22 12:06 AliShehab93

i am having same issue

prerakkumar avatar Jun 29 '22 13:06 prerakkumar

Actually I tried using this widget @override Widget build(BuildContext context) { return UnityWebWidget( url: 'http://localhost:${Uri.base.port}/UnityLibrary/index.html', listenMessageFromUnity: _listenMessageFromUnity, onUnityLoaded: _onUnityLoaded, ); } from the flutter_unity_widget_web package here it is working, but this package doesn't have the option to send messages to unity, so it needs some modifications. I am going to work on it, but right now I stick to a problem in unity when building the app, the scenes are not loaded.

AliShehab93 avatar Jun 29 '22 13:06 AliShehab93

Guys our plugin includes web + improvements from me 😅. I think you need to understand how web is working!

This plugin is building Unity for Web in "web/Unitylibrary" where an index.html is included.

To show Unity all Unity Web Plugins depends on WebViewX, where you can show Unity in a Flutter HTMLElementView Widget.

so calling "/UnityLibrary/index.html" is calling Unity inside Flutter without hosting anything.

To automate this, we released a new Version which you maybe missed.

Please have a look into the actual changelog and consider the important notes for Debug and Release Builds!

Web Is working without any problems and we tested everything in example project.

Ahmadre avatar Jul 10 '22 19:07 Ahmadre

I think I have to add a note to README. I think non-web developers and especially guys who don't know how to host websites and how web-apps and domains are working it would help to explain how to put the correct url to webUrl.

Ahmadre avatar Jul 10 '22 19:07 Ahmadre