# Switch between FreeCamera and ArcRotateCamera

**URL:** <https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593>\
**Category:** Questions\
**Created:** [March 30, 2020, 11:20am UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593 "2020-03-30T11:20:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [March 30, 2020, 11:20am UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/1 "2020-03-30T11:20:01Z")

</div>

Hello everyone,  
I’ve made this playground for switching betweend FreeCamera and ArcRotateCamera on double click.  
[https://www.babylonjs-playground.com/#2FY4XT#14](https://www.babylonjs-playground.com/#2FY4XT#14)  
I am wondering if i can remove or reduce the movement exactly when the camera is being switched.  
e.q. this is happening when you move camera and right after make a switch.  
Symlis

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 30, 2020, 12:07pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/2 "2020-03-30T12:07:23Z")

</div>

Hello,

Here: [https://www.babylonjs-playground.com/#2FY4XT#16](https://www.babylonjs-playground.com/#2FY4XT#16) . Does this help? if you detach the control from the previous camera, it works as expected.

Also, a small recommendation - try avoiding using global events in the playground, since they are not removed when you execute the playground again. You can remove them on scene dispose, but why do that when all babylon observers / events are removed every time you run the scene 🙂

---

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [March 30, 2020, 12:16pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/3 "2020-03-30T12:16:51Z")

</div>

Thank you, this is working like I needed 🙂

> @RaananW Also, a small recommendation - try avoiding using global events in the playground

sure, I’ll pay attention to this!

---

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [March 30, 2020, 1:16pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/4 "2020-03-30T13:16:28Z")

</div>

@RaananW After testing my application I came up with another idea. Would be easy to switch camera and start with the same position?  
I mean camera when being switched don’t go back to it’s old position but use the position of the second one.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 30, 2020, 1:56pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/5 "2020-03-30T13:56:33Z")

</div>

of course 🙂

You have the reference of both cameras exist, their position is there to use, both have a setPosition method. Would work!

---

<div class="post-metadata">

**Author:** ![Symlis](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/symlis/32/7350_2.png) [@Symlis](https://forum.babylonjs.com/u/Symlis)\
**Post date:** [March 30, 2020, 2:38pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/6 "2020-03-30T14:38:02Z")

</div>

[https://www.babylonjs-playground.com/#2FY4XT#18](https://www.babylonjs-playground.com/#2FY4XT#18)

Thanks for your answer.

I’ve made this working good when switching ArcRotateCamera=\> FreeCamera. I also added setTarget because I wanted to save what observer is looking at (sorry for my terminology, I am new in it 🙂 )

It doesn’t seem working on FreeCamera =\> ArcRotateCamera tho. Because the target of ArcRotateCamera becomes position of the observer and not the object.

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [March 30, 2020, 3:01pm UTC](https://forum.babylonjs.com/t/switch-between-freecamera-and-arcrotatecamera/9593/7 "2020-03-30T15:01:47Z")

</div>

The target of an arc rotate camera is fixed (unless you change it while using the camera). So the important thing is to use the position. The target of the old camera didn’t change, so keeping target as it is during this transition should work
