Hey!
This is because all internal properties are only updated at render time (to improve performance)
You can manually force it to update with camera.getViewMatrix(true): https://www.babylonjs-playground.com/#YNU38U
Notice that getTarget() returns this._currentTarget… a property that was NOT set by arcCam setTarget().
BUT, arcCam._currentTarget IS set… in line 1020, from within a private func called _getViewMatrix(). So, maybe, arcCams once called this._getViewMatrix(), but quit doing it, for some reason. Not sure, yet.
In this playground, I force-set camera1._currentTarget = vv; in line 9, and line 10 is now working correctly. I think we need to add a line or two… to arcCam’s setTarget() code.
@Deltakosh yes I verify this by creating a button and when scene is rendred I click to console the getTarget() and it works but how about universal camera I tired to change the target and then console it but the value is random ! I just change the camera type
camera = new BABYLON.UniversalCamera("Camera",new BABYLON.Vector3(0,10,0), scene);
@Deltakosh so if I understand the traget in universal camera and in arcCamera are not the same, in arcCam the target is where the camera looking to but in universal camera the target is where the camera can go by moving it , doesn’t it ?
@Deltakosh the proble is even if I use UniversalCamera when I change the target I can see it in the PG that where camera is looking through is changing to and if I make (0,0,0) the camera looks to origine and if I make (0,0,10) the camera looks to that point, but why when I console it it gives me another point !!
Targets for both are where the camera looks but for FreeCamera based (including UniversalCamera) the target is on a line starting on the camera and going through the target you gave. This is because with these cameras, when you move the mouse you will control the target.