Flomotion Posted September 2, 2015 Share Posted September 2, 2015 Hi,I'm trying to create a few camera positions that my active camera can animate/jump to. I use an array because I store all camera positions from a .babylon file. It all works fine until the camera is moved by the user. When it's moved the content of the array adjusts to the camera position of my active camera. And thus I lose the original camera position. I don't understand why that happens..I've made a playground to demonstrate: http://www.babylonjs-playground.com/#12UA27click on an object to switch camera position. I hope someone can help me fix that. thanks!Floris Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted September 2, 2015 Share Posted September 2, 2015 Hey this is because you need to keep a copy of your vector3 and not a reference:http://www.babylonjs-playground.com/#12UA27#2 Quote Link to comment Share on other sites More sharing options...
Flomotion Posted September 2, 2015 Author Share Posted September 2, 2015 That's good to know. I did try to set the value to other variables but that didn't work either. But your code does the trick! thank you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.