# ArcRotateCamera no rotation on Iphone

**URL:** <https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889>\
**Category:** Bugs\
**Created:** [March 4, 2021, 4:34pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889 "2021-03-04T16:34:03Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vinz](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@vinz](https://forum.babylonjs.com/u/vinz)\
**Post date:** [March 4, 2021, 4:34pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/1 "2021-03-04T16:34:03Z")

</div>

Hi,  
I have already commented [here](https://forum.babylonjs.com/t/zero-touch-response-on-ipad-7-2019-i-did-all-the-known-solutions/11038/30), but being an old thread I thought maybe it would make sense to create a new one.

I am experiencing no rotation with `ArcRotateCamera` (but probably the problem isn’t camera type specific), using Iphone7 IOS12 .  
I know from a fact that Iphone7 with IOS14 works, and Iphone8 with IOS13 works too.

Looking at [this PG](https://playground.babylonjs.com/#PI1KKW) getting `mouse` and no rotation seem highly correlated.

I have no idea what I could do to tackle this. Can anybody help?

I am referring to ‘rotation’ because being on BrowserStack that’s all I can check, but I am pretty also 2 fingers gestures are affected.

Thank you

---

<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:** [March 4, 2021, 4:43pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/2 "2021-03-04T16:43:02Z")

</div>

Pinging @Cedric

---

<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:** [March 4, 2021, 4:55pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/3 "2021-03-04T16:55:47Z")

</div>

Let me see if I can check on simulator …

---

<div class="post-metadata">

**Author:** ![vinz](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@vinz](https://forum.babylonjs.com/u/vinz)\
**Post date:** [March 5, 2021, 1:41pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/4 "2021-03-05T13:41:19Z")

</div>

Hi @Cedric,

I have tried having a look

1. Iphone IOS12 does not have `window.PointerEvent` nor `navigator.pointerEnabled`, so `BABYLON.Tools.GetPointerPrefix()` returns ‘mouse’ [Babylon.js/tools.ts at bfdfdab7a13bd22915c0eca320f08a61cb560d8d · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/bfdfdab7a13bd22915c0eca320f08a61cb560d8d/src/Misc/tools.ts#L300)
2. Even adjusting for that, `Pointer` events in IOS12 seem to be ‘touch’ prefixed, rather than ‘pointer’, so the events attached via `DeviceInputSystem._handlePointerActions` that use prefix from `GetPointerPrefix` won’t fire. [Babylon.js/deviceInputSystem.ts at bfdfdab7a13bd22915c0eca320f08a61cb560d8d · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/bfdfdab7a13bd22915c0eca320f08a61cb560d8d/src/DeviceInput/deviceInputSystem.ts#L534)

I used [this](https://codepen.io/undefinederror/pen/gOLjZxx?editors=1111) to check the event name. I get ‘pointer’ on IOS13 and above and ‘touch’ on IOS12 and below.

So I tried making a small change in `GetPointerPrefix` via Gitpod

```auto
if (eventPrefix === "mouse" && hasTouchend) {
  eventPrefix = "touch";
}
return prefix;

```

And now in Playground I get this error ☹

![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/05575891aa1b5ebd19cb51cd5eba07b367a0b39e.png)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/0/058f4e158c45064a6e872ff47b66917f6abf731b.png)

I am testing this in BrowserStack, and breakpoints don’t work. I don’t think I can manage to do much more than this.

This is the url to the Gitpod container  
[https://1338-silver-reptile-4h65jmov.ws-eu03.gitpod.io/Playground/index-local.html](https://1338-silver-reptile-4h65jmov.ws-eu03.gitpod.io/Playground/index-local.html)

---

<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:** [March 5, 2021, 3:22pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/5 "2021-03-05T15:22:38Z")

</div>

That’s far beyond my knowledge on input. Pinging @PolygonalSun

---

<div class="post-metadata">

**Author:** ![vinz](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@vinz](https://forum.babylonjs.com/u/vinz)\
**Post date:** [March 16, 2021, 4:16pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/6 "2021-03-16T16:16:08Z")

</div>

@PolygonalSun (or whoever is willing and able)  
Any chance you could give me a hand with this?

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [March 16, 2021, 4:28pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/7 "2021-03-16T16:28:25Z")

</div>

Lemme take a look at this and see what’s going on

---

<div class="post-metadata">

**Author:** ![vinz](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@vinz](https://forum.babylonjs.com/u/vinz)\
**Post date:** [March 25, 2021, 2:34pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/8 "2021-03-25T14:34:31Z")

</div>

Hey @PolygonalSun, have you figured out anything?  
Sorry if I insist, but it is unfortunately imperative for us to support IOS 12 in our Babylonjs project.

Let me know if you have any news. Thank you

---

<div class="post-metadata">

**Author:** ![PolygonalSun](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/polygonalsun/32/2704_2.png) [@PolygonalSun](https://forum.babylonjs.com/u/PolygonalSun)\
**Post date:** [March 25, 2021, 5:48pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/9 "2021-03-25T17:48:06Z")

</div>

So here’s what I’ve got so far. If the event is being treated like a TouchEvent, rather than a PointerEvent, this would explain the error. First, we track all touches with pointerId, which TouchEvent doesn’t have. The biggest issue that I’ve been encountering is finding a way to debug this, as I don’t have a device with iOS 12.

The best way that I could think to fix this would be to find a good way to identify when dealing with TouchEvents and then have a proper way to assign and track their ids, as though they were pointerIds

---

<div class="post-metadata">

**Author:** ![vinz](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@vinz](https://forum.babylonjs.com/u/vinz)\
**Post date:** [March 26, 2021, 12:09pm UTC](https://forum.babylonjs.com/t/arcrotatecamera-no-rotation-on-iphone/18889/10 "2021-03-26T12:09:16Z")

</div>

Hey @PolygonalSun,  
Thank a lot for looking into it.

I think I solved it! 🥳

Importing [pepjs](https://www.npmjs.com/package/pepjs) (Pointer Events Polyfill) seems enough get pointer events going

This PG works for me on IOS12 and even 11 (browserstack)  
[https://playground.babylonjs.com/#PI1KKW#10](https://playground.babylonjs.com/#PI1KKW#10)
