Issue in moving camera to the position of a specific child

Hi all , I want my camera to focus on a specific child of the model .

var childObject = scene.getObjectByName(“Core_Sacrum”);
camera.position.set(childObject.position.x, childObject.position.y, childObject.position.z+5);
camera.lookAt(childObject.position);

In the above code , I’m getting the position of the child on which I want to focus the camera , then I’m trying to set the camera on that position . But no matter what the position of the child is , the camera is always stuck at one spot , I tried giving the position manually also , but still it is at the same place.

This code fragment is not sufficient to guess what the problem is. If you can make an online demo (e.g. in CodePen or a similar site), it might help a lot.

One possible reason is if you have OrbitControls (or another controls). OrbitControls takes control over the camera, so you should not modify the camera manually, while OrbitControls is enabled.