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

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:

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 :thinking:
Any ideas?

ArcRotateCamera and FreeCamera have different constructors.

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

3 Likes

Argh, what a silly mistake…
Thanks so much.

1 Like