Camera dont start on "Camera Entity" - position x

Hi,

I try Model Viewer Starter Kit and if i set Camera Position x to another value camera dont start at the new position. But if i change in script Distance Max then camera position change. What can i do? Thanks.

Hi @Daniel_B,

If you are using that starter kit, the orbit-camera.js script that is attached to your camera will calculate and set the position on each frame. Meaning if you are trying to override the camera position from another script that won’t work.

What are you trying to do? If you’d like to focus your camera to a specific point, you can add an entity placed at that position as Focus Entity on the orbit camera script.

1 Like

Hi @Leonidas and thank you for your response,

I would like the camera to start a little further forward than max distance so that the user can small with scroll back the 3D scene until distance max or conversely enlarge it with scroll forward until distance min.

Hi @Daniel_B,

I see, another idea to try is to set the max distance to a larger value on start. And in your mouse/touch input handlers allow only for zooming (scroll forward).

As soon as the camera has reached the regular max distance, then set the value to that and re-enable regular zooming in/out.

The base place to do that would be the orbit camera mouse and touch input scripts.

1 Like

Disable ‘frameOnStart’ on the orbit camera and position the camera entity where you would like it to start.

The code should handle the rest.

If you are still having issues, please share a project example of the issue you are having

2 Likes