How to add camera to a scene in the editor

How do you add a camera to a scene in the editor? I can’t figure it out.

The default editor scene has the editor camera, and it works with the game tab. However, you cannot clone that camera. There is no button to add a camera n the add tab

Pinging @julien-moreau

I feel like the thing where if someone replies something like you did it does ping the original poster would be nice. I got all excited for help pinging someone :wink:

1 Like

Hey. as far as I understand, you cannot add a camera from the editor interface. only through the code editor can you add a camera by linking it to the scene. you need to assign a script to the scene and create a camera with a code, plus indicate that it is an active camera, but after that the camera is still not accessible from the editor’s interface

That’s odd. The is a little image of a camera for the default editor camera. It also has different properties. It might be hidden, but if I do have to do it though code, maybe a dummy will change into a camera.

Perhaps this is a bug, and you are not supposed to be able to add cameras.
But, if you change your camera to Arc Rotate camera and then right click on the editor camera, you can clone it.

Thanks! But why are you not supposed to add cameras?

I think my sentence was confusing maybe. I am not sure whether you are supposed to or not, that is a question for the author, I think @julien-moreau. That video I linked it just showing either a work around, or a bug in the code base.

oh. Well, at least it works. Thanks for the help!

I get it now!

I made a scene and added a sphere. I added a script called “Player” and added these lines to it:

var cam = new BABYLON.FreeCamera("camera", new BABYLON.Vector3(0, 0, 0), scene);
        cam.attachControl(scene.getEngine().getRenderingCanvas());

Under the constructor section.
It works like a charm!

Hey ! Sorry for the delay and thanks for the help ! You rox!
You are right the editor misses this feature so I’m adding right now :slight_smile:
The main idea was that cameras were always added in scenes using blender or 3ds Max so it wasn’t asked to add cameras from the editor. I’ll let you know once the editor has been released with the cameras support :slight_smile:
Thanks!

Thanks for the help! I saw the little camera icon so I thought something was wrong. I’ll work with the code lines I have until the update comes. :wink: