Combine multiple animation together

My playground works with just three animations combined together, but it does not work when I added 3 more, it does not set the x,y,z of the camera correctly, is scene.beginDirectAnimation is the right method when combine with so much animation? I also checked console, I do not see any error, not sure what’s went wrong? Thanks!

Camera movement | Babylon.js Playground (babylonjs.com)

Hi @pigga

You are using a ArcRotateCamera. Does it support position properties? ArcRotateCamera is controlled through alpha, beta, radius, and plus the camera target position. Maybe changing camera.position.xyz wouldn’t have any impact.

2 Likes

Hi @pigga - Let see if @PolygonalSun, who did some nice articles about camera in Babylon.js (Looking at Custom Camera Inputs. One of the more common questions I see… | by Babylon.js | Medium or Cameras: Is what you see, what you get? | by Babylon.js | Medium) has an idea?

1 Like

Thank you, but we still allow user to pan using arc rotate camera, (if you right click the scene and drag, you can see the movement for camera), if user pan to different camera position, we need to move that back

If you open the inspector, you can see that panning is changing the target position, not camera position.

See this PG: https://playground.babylonjs.com/#A584HZ#20

2 Likes

Ah, I see what you mean, so it should be camera.target.x not camera.position.x, I made some changes, but still does not see camera move

Camera movement | Babylon.js Playground (babylonjs.com)

Sorry, what do you mean you don’t see camera move?

Sorry for the confusion, I just checked your playground provided above again, the target position did move with animation, but you set the xyz to be 0, so I do not notice it, thank you!

I changed the playground to set the target position for sphere 1 to better see the target position change
Camera movement | Babylon.js Playground (babylonjs.com)

2 Likes