r/FlutterDev • u/dreamsoftin • Feb 19 '20
Video Flutter + Unity3D AR Foundation
https://www.youtube.com/watch?v=A56gVrDAXbU5
u/aytunch Feb 19 '20 edited Feb 19 '20
Is there any github repo for this project? Did you implement the AR filters yourself or are they available inside of Unity as plugins? Please share more info. This looks cool but the video does not give us devs any hints as to how this is made
12
u/dreamsoftin Feb 19 '20
This is a commercial product hence the source cannot be shared. But I can share details on how this can be easily recreated
This is a Flutter application with embedded Unity Project. We have used https://github.com/snowballdigital/flutter-unity-view-widget for embedding Unity3D
All the business logic & UI elements are implemented on Flutter including the AR Face selection UI on top the camera feed.
Flutter app directly communicates with Unity3D using Flutter platform channels. API's are part for the flutter-unity-view-widget plugin
We have built the AR Face masks in Blender & Unity3D. App also includes 2 masks from ARFoundation samples project https://github.com/Unity-Technologies/arfoundation-samples.
For AR, we are using Unity3D AR Foundation, a wrapper for ARCore & ARKit which allows you to build AR applications for both android & ios
You can start from this Flutter Unity3D AR example https://github.com/juicycleff/flutter-unity-arkit-demo
Integration is not limited to AR. Any game or interactive Unity3D application can be embedded with Flutter
1
u/_HEATH3N_ Feb 19 '20
Were there any snags developing this way? How do you debug? I think I tried using a Unity view embedded in an Android app once but constantly re-exporting to get the updated Unity app in Android Studio quickly became tiring. Maybe I was just doing it wrong.
1
u/dreamsoftin Feb 19 '20
Yes. Continuous integration is difficult. Initially, we did export Unity3D multiple times to test the integration. Once we finished the communication part, We built both the apps separately. We built a temporary UI to test the Unity3D app separately.
2
u/zvrksam86 Feb 20 '20
Can you tell how much is the app size ? And how much unity adds Mb to the whole app ?
1
0
0
u/NEVAC14 Feb 19 '20
can you share the source code.... I would like to look into it , and try to create a new one for mine???
0
Feb 19 '20
[deleted]
7
u/dreamsoftin Feb 19 '20
Yes. We work on both Unity3D and Flutter extensively. We find UI development in Flutter easy and fast.
AR is only a part of the app. There are many UI extensive features like infinite scroll view with inline video playback, store, social elements like posting, likes, comments, chat etc. It's doable in Unity3D, but we did it a lot faster with the help of Flutter.
3
u/operation_karmawhore Feb 19 '20
This.
We're currently escaping the Unity UI Hell with a Webview (with transparent background) on top of Unity where Unity just acts as a slave with AR content (the Webview is the master)
We use this (in case of interest): https://github.com/gree/unity-webview
UI in Unity is neither fun nor productive. Webdev or Flutter does make this process so much easier.
9
u/dreamsoftin Feb 19 '20
We have added AR to Flutter app with the help of flutter_unity_widget