Hi everyone,
I seen in a playground, with what i think is a freecamera, a camera who return automaticly to his default target, his default position. But i don’t remember where and i tried vainly to find him…
has anyone got an idea to do this or got a playground who do what i’ve describ ?
The ArcRotateCamera has the useFramingBehavior property which does what you describe. Here’s the docs
HTH
4 Likes
There’s also storeState
and restoreState
on all the TargetCamera
types cameras that stores all the properties of the camera and restores them:
TargetCamera | Babylon.js Documentation (babylonjs.com)
Here’s a simple playground with the idea (press “0” to restore the starting state of the camera):
FreeCamera_MouseWheel | Babylon.js Playground (babylonjs.com)
4 Likes