If not - is it possible to parent the universal camera? Looking at the docs it does not seem possible. So is there no way to make a smooth focussing of the universal camera? Does that only work with the arc rotate camera?
The playground overwrites the setTarget function with vectors; you can add a custom setter to the camera that will pass the vectors to the setTarget function instead:
Thank you very much for that answer - that helped a lot!
I do want to animate the target and the position of the universal camera simultaneously - so i need two animations, one for the position and one for the target.
What i don’t understand: if scene.beginAnimation(camera2, 0, 100, false) is only specific to the object but not to the animation, how can i play two animations at the same time for one object? Or is there a way to combine multiple animations in one? If tried grouping, but couldn’t work it out.
Well. I know Babylon have animation system and it’s really cool. But lately I am combining GSAP with Babylon, and they work really good together. It’s really simple to nest animations with GSAP, to set timing of animations, easing, and you can pretty much animate any property. Plus GSAP gives you so many solutions for animating anything on your site.
This is part of code where I animate properties of the camera. Basically, the logic is, first “to” is executed, then next one follows then next one follows…etc…
But you can control this, for example, if you want second animation to start before the first one ends, you can add last property like this “-=1” which means, start second animation 1 second before first animation ends. You can see in the code that I used this for last two “to” methods.
GSAP timelines also give you a bunch of methods to control animation playing (play, pause, stop…). Also you get a bunch of observables (onEnd, onProgress, onStart…).
One note: GSAP is not completely free. You can read the licensing rules on their site. But if your project falls under the conditions of Standard “No Charge” License, you are good to go.