# PointerDragBehavior slow on babylon-reactnative but fine on Chrome

**URL:** <https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530>\
**Category:** Bugs\
**Tags:** native, performance\
**Created:** [May 5, 2023, 3:49pm UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530 "2023-05-05T15:49:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antoine\_Bonavita](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/antoine_bonavita/32/31977_2.png) [@Antoine\_Bonavita](https://forum.babylonjs.com/u/Antoine_Bonavita)\
**Post date:** [May 5, 2023, 3:49pm UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530/1 "2023-05-05T15:49:40Z")

</div>

Hello,

I am trying to add a new feature to an existing application: load objects in AR and move them using the DragPointerBehavior.  
I am using babylon/react-native 1.5.1 with babylon/core 5.57.1, babylonjs/react-native-iosandroid-0-70 and react-native 0.70.7 and testing on my Android device.  
As long as the loaded object is small (e.g. `https://raw.githubusercontent.com/KhronosGroup/glTF-Sample-Models/master/2.0/BoxAnimated/glTF-Binary/BoxAnimated.glb`) things are pretty smooth but if I use bigger objects (`https://playground.babylonjs.com/scenes/skull.babylon` or `https://raw.githubusercontent.com/wallburners/test/main/winged_victory_of_samothrace.glb`) things get really bad: as soon as I click on the object the whole camera freezes and it’s almost impossible to move the objects.  
On the other hand, when I do the same with “vanilla” babylonjs in Chrome on the same device ([https://playground.babylonjs.com/#XNDGIG#6](https://playground.babylonjs.com/#XNDGIG#6)) things are fine.

I built a sample app (highly inspired from BabylonJS/BabylonReactNative Playground App) to reproduce the problem. To use different meshes, press “Toggle EngineScreen” and loop through the 3 URLs mentioned above.  
The source code is available at [GitHub - wallburners/test](https://github.com/wallburners/test) and all you have to do is run `npx react-native run-android`.

At this stage I’m completely lost and could definitely use some help from the gurus around here.

Thanks in advance,

Antoine.

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [May 9, 2023, 4:15pm UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530/2 "2023-05-09T16:15:08Z")

</div>

@Cedric might be able to help on this one ?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 9, 2023, 4:20pm UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530/3 "2023-05-09T16:20:53Z")

</div>

Hey @Antoine_Bonavita welcome to the forum!

Can you please try to set these properties to true on the scene:

> **[Scene | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#skipPointerDownPicking)**
>
> Represents a scene to be rendered by the engine. \[API\]

> **[Scene | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#skipPointerMovePicking)**
>
> Represents a scene to be rendered by the engine. \[API\]

> **[Scene | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#skipPointerUpPicking)**
>
> Represents a scene to be rendered by the engine. \[API\]

and also, try this property:

> **[ScenePerformancePriority | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/enums/BABYLON.ScenePerformancePriority)**
>
> Define how the scene should favor performance over ease of use \[API\]

Chrome on the browser uses JIT whereas, on reactive native, there is not jit.

---

<div class="post-metadata">

**Author:** ![Antoine\_Bonavita](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/antoine_bonavita/32/31977_2.png) [@Antoine\_Bonavita](https://forum.babylonjs.com/u/Antoine_Bonavita)\
**Post date:** [May 9, 2023, 7:52pm UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530/4 "2023-05-09T19:52:36Z")

</div>

Hello @Cedric,

Thanks for the help (and the great work on babylon react native). Unfortunately “it does not work”. 😢

To be a bit more precise:

- If I set the performancePriority to Aggressive, the “animated box” mesh does not show and the “skull” cannot be picked.
- If I set performancePriority to Intermediate, everything shows but the objects cannot be picked.
- If I do not set performancePriority (which should default to BackwardCompatible) but set the skipPointer\*Picking to true, the objects cannot be picked.

In all those situations, I don’t have the “camera freeze” problem that I am seeing when dragging objects.

If there is anything I can do to help diagnose the problem, please let me know.

Antoine.

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 10, 2023, 7:35am UTC](https://forum.babylonjs.com/t/pointerdragbehavior-slow-on-babylon-reactnative-but-fine-on-chrome/40530/5 "2023-05-10T07:35:13Z")

</div>

Did you try to set this to true ? [Scene | Babylon.js Documentation](https://doc.babylonjs.com/typedoc/classes/BABYLON.Scene#skipPointerMovePicking)
