# ML2 Unity WebRTC Sample

**URL:** <https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539>\
**Category:** Unity Development\
**Tags:** unity\
**Created:** [August 10, 2022, 1:34pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539 "2022-08-10T13:34:35Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.magicleap.cloud/u/Andrew)\
**Post date:** [August 10, 2022, 1:34pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/1 "2022-08-10T13:34:35Z")

</div>

Hi,

where I can find the Unity WebRTC sample for Magic Leap 2? I had it previously, but cannot find it or the URL.

Andrew

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [August 10, 2022, 4:49pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/2 "2022-08-10T16:49:27Z")

</div>

@Andrew , the Unity examples can be downloaded via The Lab 2.0, in the Package Manager, under the "All" tab, then Unity Packages \> Unity Examples. They are downloaded to your ~/home/MagicLeap/tools/ directory.

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.magicleap.cloud/u/Andrew)\
**Post date:** [August 10, 2022, 5:40pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/3 "2022-08-10T17:40:59Z")

</div>

I didn't realize it was in there. I new to working in Unity, so this could be something really simple.

Here is what I have installed from The Lab 2.0

 ![InstalledPackages](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/5257204cc24c1ae5164c3c7aa60b7571bce0137a.png)

I have Unity Editor 2022.2.0a14.2907 installed, and when I open the samples, I am getting script compilation errors.

I have added the MLSDK package  
 ![MLSDKPackageInstalled](https://us1.discourse-cdn.com/flex019/uploads/magicleap1/original/1X/4cf793c35f855fcc2fa0483cd66b0464670c71b5.png)

From [2. Import Unity Tools | MagicLeap Developer Documentation](https://developer.magicleap.cloud/learn/docs/guides/unity/getting-started/import-unity-packages), it mentions **com.unity.xr.magicleap.zip** , which I do not have.

Here are some of the errors:  
Packages\com.magicleap.unitysdk\Subsystems\Gesture\Extensions\TouchpadGestureEvent.cs(17,22):  
error CS0234: The type or namespace name 'InteractionSubsystems' does not exist in the namespace 'UnityEngine.XR' (are you missing an assembly reference?)  
Packages\com.magicleap.unitysdk\Subsystems\Gesture\GestureSubsystem.cs(20,22):  
error CS0234: The type or namespace name 'InteractionSubsystems' does not exist in the namespace 'UnityEngine.XR' (are you missing an assembly reference?)  
Packages\com.magicleap.unitysdk\Subsystems\Gesture\GestureSubsystemComponent.cs(17,22):  
error CS0234: The type or namespace name 'InteractionSubsystems' does not exist in the namespace 'UnityEngine.XR' (are you missing an assembly reference?)  
Packages\com.magicleap.unitysdk\Subsystems\ImageTracking\ImageTrackingSubsystem.cs(12,32):  
error CS0234: The type or namespace name 'Internal' does not exist in the namespace 'UnityEngine.XR.MagicLeap' (are you missing an assembly reference?)

Andrew

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [August 10, 2022, 5:45pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/4 "2022-08-10T17:45:42Z")

</div>

We will be releasing an updated SDK likely today that will have the public-facing Unity and XR packages. If you do not have an email with instructions on downloading this XR package, we would recommend waiting and downloading the new SDK files via The Lab.

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.magicleap.cloud/u/Andrew)\
**Post date:** [August 10, 2022, 6:40pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/5 "2022-08-10T18:40:09Z")

</div>

I do not recall receiving one, but there's an SDK update coming? that's great. I will keep an eye out for it.

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [August 10, 2022, 6:44pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/6 "2022-08-10T18:44:34Z")

</div>

@Andrew check your direct messages for information on continuing.

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.magicleap.cloud/u/Andrew)\
**Post date:** [August 11, 2022, 2:27pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/7 "2022-08-11T14:27:35Z")

</div>

@sengelman, it seems I'm still having a bit of trouble. I uninstalled my editor and reinstalled using the Editor from the link you provided. In case it matters, I copy ~\MagicLeap\tools\unity\v0.53.1\MagicLeap\_Examples to a new location before I open it in Unity.

Under Preferences-\>External Tools, I set the MLSDK path to: ~MagicLeap\mlsdk\v0.53.1

Trying to resolve some script errors, I imported the com.unity.xr.magicleap package, but then warns of duplicates between it and another, so I removed it.

Without it, I'm seeing errors about missing types/namespaces, which include URP, UnityEngine.XR.MagicLeap.Internal, UnityEngine.XR.InteractionSubsystems, etc.

Here are the console messages I'm seeing  
[ScriptErrors.txt](https://forum.magicleap.cloud/uploads/short-url/prUfWvvr8sTklcFzO4bVx9FmNrI.txt) (10.2 KB)

Also, I noticed a WebRTC folder under examples, which is a simple webpage. Will be helpful, but I'm under the impression there's a Unity WebRTC sample: like the one for ML1

Andrew

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [August 11, 2022, 3:18pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/8 "2022-08-11T15:18:50Z")

</div>

You should install the editor using the link for Unity Hub, _not_ the Download Assistant.

Please start a new project from scratch using these instructions:

[Getting Started](https://developer.magicleap.cloud/learn/docs/guides/unity/getting-started/set-up-development-environment)

---

<div class="post-metadata">

**Author:** ![Andrew](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@Andrew](https://forum.magicleap.cloud/u/Andrew)\
**Post date:** [August 11, 2022, 5:33pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/9 "2022-08-11T17:33:51Z")

</div>

There we go. I saw that page before, but this time around my eyes didn't glaze over. there were numerous things I didn't get to. Made a few assumptions, I think.

Will I have to do this for the Unity samples? It wouldn't hurt to check, I suppose.

I have deployed a unity app to the device, so things are looking up.  
Thanks for the help.

---

<div class="post-metadata">

**Author:** ![sengelman](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/sengelman/32/11_2.png) [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Post date:** [August 11, 2022, 5:46pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/10 "2022-08-11T17:46:26Z")

</div>

I would recommend performing these steps, and dropping everything from `Assets` in the Unity Examples project into your from-scratch project.

---

<div class="post-metadata">

**Author:** ![dev](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/dev/32/141_2.png) [@dev](https://forum.magicleap.cloud/u/dev)\
**Post date:** [August 16, 2022, 12:34pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/11 "2022-08-16T12:34:17Z")

</div>

(Don't mind me. Just saying hi to Shane! Hope you're doing well) -it's Devon🙂

---

<div class="post-metadata">

**Author:** ![dev](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/dev/32/141_2.png) [@dev](https://forum.magicleap.cloud/u/dev)\
**Post date:** [August 17, 2022, 10:14am UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/12 "2022-08-17T10:14:49Z")

</div>

Ok, I have an actual/serious ML2 question. (Apologies I’m still getting reacquainted with this forum’s format) Sending out it tomorrow! It is relevant to this thread though🙌

---

<div class="post-metadata">

**Author:** ![kbabilinski](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kbabilinski/32/19_2.png) [@kbabilinski](https://forum.magicleap.cloud/u/kbabilinski)\
**Post date:** [April 17, 2024, 9:04pm UTC](https://forum.magicleap.cloud/t/ml2-unity-webrtc-sample/539/13 "2024-04-17T21:04:16Z")

</div>


