Camera position

How can I get the camera position and direction

You can do this for x,y and z , alpha beta:

console.log(Tools.ToDegrees(camera.alpha));  //or beta

or this:

scene.onBeforeRenderObservable.add(() => {

hope that helps

1 Like

@AbdulrehmanSuliman please provide a playground of what you tried and such so that we can help accordingly also you can usually have a look in our api doc for those: Camera | Babylon.js Documentation


For all cameras, you can generally get the position by using camera.position and using camera.getDirection(vector) for direction. The vector argument in that function is the local axis to use as your frame of reference. For example:

// Get the forward direction
const direction = camera.getDirection(BABYLON.Vector3.Forward())
1 Like