r/FlutterDev • • Feb 19 '20

Video Flutter + Unity3D AR Foundation

https://www.youtube.com/watch?v=A56gVrDAXbU
131 Upvotes

12 comments sorted by

View all comments

5

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.