Lock the avatar in mobile and tab


In Ipad Tab and mobile we need to lock the avatar by not making it move sideways or upside down. But it can rotate around itself on same position

I tried with the below approach it is not working. pls suggest

If you want to set the pivot point around which the camera rotates, you can use setTarget: FollowCamera | Babylon.js Documentation (babylonjs.com)

I just tried with your suggestion
camera.setTarget(new BABYLON.Vector3(0, 0, 0));
Still same problem is persisting

The camera’s target is already (0,0,0) by default, you need to set it in your model’s position:
vijay_krishna model | Babylon.js Playground (babylonjs.com) (see line 70)

Hello @vijay_krishna just checking in if your question has been answered

1 Like

@carolhmj able to lock the avatar in sideways only…
but it can be rotated upside/down can we restrict this as well.

That should be possible with the upper and lower camera limits.