Here's a WebAR demo project that integrates echo3D and Zappar SDKs in Unity.
- Built with Unity 2020.3.25. (Note: The echo3D Unity SDK is supported in 2020.3.25 and higher.)
- Register for FREE at echo3D.
- Add the Unity SDK. Troubleshoot here.
- To view a completed demo project that only requires the echo3D API key & entry ID, clone this repo.
Watch here.
- Add these models to the echo3D console from the Unity Assets/Models folder:
- CowboyHat
- Delete the default camera in the scene. From the Unity toolbar, Zappar > Camera > Front Facing Camera game object from the Zappar menu.
- Add any Zappar Tracking object from the Zappar menu. We used the Face Tracking Target.
- Select the Zappar camera game object and drag the tracking type (in your Hierarchy) into the "Anchor Origin'' property.
- Drag the echo3D script onto an empty parent for your echo3D asset. See CowboyHat in the Hierarchy.
- Set the API key and Entry IDs for those same models in the Inspector.
- Type your Secret Key as the value for the parameter secKey in the file Packages/co.echo3D.unity/Runtime/Echo3DHologram.cs. (Note: Secret Key only matters if you have the Security Key enabled). You can turn it off in the Security options in your echo3D console.
- (Recommended) To move, resize or edit the assets live in your Scene view, check the boxes for “Editor Preview” and “Ignore Model Transforms”. To enable this, click Echo3D > Load Editor Holograms in your Unity toolbar.
- Change Build Settings to WebGL.
- Go to Build Settings > Player > Resolution and Presentation and select the Zappar player (Zappar for 2020+, or Zappar 2019 for anything older).
Build for WebGL, view WebAR experience through desktop browser. Desktop camera access is required.
Refer to our documentation to learn more about how to use Unity and echo3D.
Visit our troubleshooting guide here.
Feel free to reach out at support@echo3D.co or join our support channel on Slack.