Simple Camera Focus

Hi ı have a problem anybody help me?

I WANT TO FOCUS THE CAMERA ON THE OBJECT I CHOOSE BUT I CAN’T

focuschange forced to work but statechange is null //returns this value//

Hi!

YOU CAN FOR EXAMPLE USE THE camera.setTarget(Vector3) FUNCTION TO FOCUS THE CAMERA ON A GIVEN 3D Vector or the lockedTarget property of a TargetCamera which you can use to focus at a mesh or position.

For more information please have a look at the documentation:

:vulcan_salute:

1 Like

thanks for your feedback but
ı can use function the other component like this
onClick={() => focusChangeCamera(meshName, scene, boothName)}
but i can’t use it here

mesh.actionManager.registerAction(

    new ExecuteCodeAction(ActionManager.OnPickTrigger, () => {

      focusChangeCamera(mesh, StateScene, gltfName);

    })

  );

I made the variable names specific to that field, and it doesn’t work when I make the variable names as above.

When I click on the object I want to focus on, it leaves the free camera and switches to the arcrotate camera.but definitely not able to animate

1 Like

Could you kindly provide a repro with your problem in PG?
It would be much easier to help.

1 Like

problem is fixed :slight_smile:

now ı can try to text on mesh

ı can fixed image on mesh but ı cant to same thing for text

const url = URL.createObjectURL(file); for image

const url = value.createObjectText(value); for text // wrong code

2 Likes

Hello @Knifepro just checking in, do you still have any questions?

1 Like

i fix the problem thanks