How does the babylon control the rotation of FreeCamera?

I want to control FreeCamera’s rotation use its own function. But when it is mobile platform, as long as the pointer goes inside GUI, then I can not control the camera’s rotation any more.

Do you ask how input (by mouse) changes rotation? Then you might want to follow code from here:

Or do you want to customize camera control by mouse input control (i.e. no rotation)?

If you just want to enable “dragging” camera rotation by mouse when over GUI, you can set:

guiControl.isPointerBlocker = false; // or true if you want it the other way around

Also you can set rotation(Quaternion) directly or use setTarget().


My problem is that when I slide my finger from outside to inside GUI, then pull my finger up to leave the screen, after which I can not control the FreeCamera’s rotation anymore.

Can you try to set:

...isPointerBlocker = false

on your gui controls/elements?

It looks to me in this case pointer and touch events are handled equally, but could be wrong maybe @PolygonalSun or @carolhmj knows better.

No, you’re good (as always :smiley:) I believe this part of the issue has been fixed in a duplicate of this post.
@Digital_Mimesis_Lab may I ask you to try avoid posting twice on a same issue. I know it is not the same question but in the end, it is all related and our answers would be faster and more accurate if we had the entire context in a single post (just sayin). Else, have a great day :sunglasses:

This is where you detect the (scene) pointer event and set your camera. If you pick the ‘root’ freecam is active, if you pick ‘adt’ then the GUI camera is active. I believe you should already have this part in the other post (if I remember correctly). Else, let us know.

1 Like