# Prevent camera from passing through GLB object

**URL:** <https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243>\
**Category:** Questions\
**Tags:** arcrotatecamera\
**Created:** [June 11, 2024, 5:44pm UTC](https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243 "2024-06-11T17:44:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rovanandrianina\_Solo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rovanandrianina_solo/32/40300_2.png) [@Rovanandrianina\_Solo](https://forum.babylonjs.com/u/Rovanandrianina_Solo)\
**Post date:** [June 11, 2024, 5:44pm UTC](https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243/1 "2024-06-11T17:44:00Z")

</div>

Hello,  
I want to prevent the camera from passing from glb objects when using zoom and rotation.  
I tested with:  
camera.useFramingBehavior = true;  
but it does not work.  
Can you help me please.  
Here is my playground: [Babylon.js Playground](https://playground.babylonjs.com/#RS4OSM)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 11, 2024, 5:52pm UTC](https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243/2 "2024-06-11T17:52:10Z")

</div>

To make it work you have to create an invisible object that encompasses the entire scene and make the camera target it then framing behavior will work

---

<div class="post-metadata">

**Author:** ![Tricotou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tricotou/32/5844_2.png) [@Tricotou](https://forum.babylonjs.com/u/Tricotou)\
**Post date:** [June 11, 2024, 5:56pm UTC](https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243/3 "2024-06-11T17:56:57Z")

</div>

Hello 🙂

If you speak about enabling checkcollisions on ArcRotateCamera, you can try this :

```javascript
scene.collisionsEnabled = true;
camera.checkCollisions = true;
camera.collisionRadius = new BABYLON.Vector3(0.5, 0.5, 0.5);

```

[Playground](https://playground.babylonjs.com/#RS4OSM#1)

++  
Tricotou

---

<div class="post-metadata">

**Author:** ![Rovanandrianina\_Solo](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rovanandrianina_solo/32/40300_2.png) [@Rovanandrianina\_Solo](https://forum.babylonjs.com/u/Rovanandrianina_Solo)\
**Post date:** [June 11, 2024, 6:27pm UTC](https://forum.babylonjs.com/t/prevent-camera-from-passing-through-glb-object/51243/4 "2024-06-11T18:27:49Z")

</div>

Yess !! it works.  
Thank you very much.
