ArcRotateCamera limiting the rotation

Hi, new at Bjs i am looking a way to limit the rotation of ArcRotateCamera so it dosent look under a plane

https://www.babylonjs-playground.com/#SSIKJY

OK got it I just aded the line:
camera.upperBetaLimit = Math.PI/2 ; //(it is equalt to 1.57079… just round it to 1.57)
camera.upperBetaLimit = 1.57) // you can write it like this and by increasing the value of 1.57 eg. to 1.85 you go tiny bit under

Hi @kingpixel and welcome to the forum. It always great when people find their own solutions -excellent :smile:

1 Like