# Getting "getUniqueId is not a function" when creating a free camera

**URL:** <https://forum.babylonjs.com/t/getting-getuniqueid-is-not-a-function-when-creating-a-free-camera/21548>\
**Category:** Questions\
**Created:** [June 10, 2021, 7:24am UTC](https://forum.babylonjs.com/t/getting-getuniqueid-is-not-a-function-when-creating-a-free-camera/21548 "2021-06-10T07:24:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [June 10, 2021, 7:24am UTC](https://forum.babylonjs.com/t/getting-getuniqueid-is-not-a-function-when-creating-a-free-camera/21548/1 "2021-06-10T07:24:19Z")

</div>

Hello,  
i am trying to replace my ArcRotateCamera with a FreeCamera and I am now getting the “getUniqueId is not a function” error.

this is the camera creation code:

```auto
if(cameratype==="arc"){
    this._camera = new BABYLON.ArcRotateCamera("Camera", -Math.PI / 2, Math.PI / 2, 12, BABYLON.Vector3.Zero(), this._scene);
}else{
    this._camera = new BABYLON.FreeCamera("Cameras", -Math.PI / 2, Math.PI / 2, 12, BABYLON.Vector3.Zero(), this._scene);
}

```

The creation of the ArcRotateCamera does not create a problem 🤔  
Any ideas?

---

<div class="post-metadata">

**Author:** ![labris](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/labris/32/12576_2.png) [@labris](https://forum.babylonjs.com/u/labris)\
**Post date:** [June 10, 2021, 9:17am UTC](https://forum.babylonjs.com/t/getting-getuniqueid-is-not-a-function-when-creating-a-free-camera/21548/2 "2021-06-10T09:17:21Z")

</div>

ArcRotateCamera and FreeCamera have different constructors.

```auto
   // This creates and positions a free camera (non-mesh)
    var camera = new BABYLON.FreeCamera("camera1", new BABYLON.Vector3(0, 5, -10), scene);

```

> **[ArcRotateCamera | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.arcrotatecamera#constructor)**
>
> This represents an orbital type of camera. \[API\]

> **[UniversalCamera | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/babylon.universalcamera#constructor)**
>
> The Universal Camera is the one to choose for first person shooter type games, and works with all the keyboard, mouse, touch and gamepads. This replac

---

<div class="post-metadata">

**Author:** ![EvilTwinsNiceBrother](https://avatars.discourse-cdn.com/v4/letter/e/51bf81/32.png) [@EvilTwinsNiceBrother](https://forum.babylonjs.com/u/EvilTwinsNiceBrother)\
**Post date:** [June 11, 2021, 5:45am UTC](https://forum.babylonjs.com/t/getting-getuniqueid-is-not-a-function-when-creating-a-free-camera/21548/3 "2021-06-11T05:45:24Z")

</div>

Argh, what a silly mistake…  
Thanks so much.
