Can't change the target Position of an AcrRotateCamera

How can I change the target position of an ArcRotateCamera?
In my understanding it’s like this:
var camera = new BABYLON.ArcRotateCamera(“Camera”, 0.0, 0.9, 10, BABYLON.Vector3(0.0, 0.0, 0.0), scene);
…where the BABYLON.Vector3 is defining the target position. That would mean, when I want to rotate around an lower position I could change this e.g. (0, 0, -100) - but nothing happens, no matter what values are used. What am I doing wrong?

Kind wishes, Marcus

Hi @Marcus_W3

var camera = new BABYLON.ArcRotateCamera(“Camera”, 0.0, 0.9, 10, BABYLON.Vector3(0.0, 10.0, 0.0), scene);

BABYLON.Vector3 is a constructor. It looks like you missed the ‘new’ keyword.

var camera = new BABYLON.ArcRotateCamera(“Camera”, 0.0, 0.9, 10, new BABYLON.Vector3(0.0, 10.0, 0.0), scene);

2 Likes

Hello and welcome!

The easiest way to play with different properties is to open the Inspector (one of the buttons at the top menu of the PG)

To change camera properties after its creation use

   camera.target = new BABYLON.Vector3(1,1,2)
   camera.alpha = BABYLON.Tools.ToRadians(45);
   camera.beta = BABYLON.Tools.ToRadians(60)
   camera.radius = 5;

See also ArcRotateCamera | Babylon.js Documentation

@slin: Thanx a lot! Now it works!!! :smiley:

2 Likes