jamespierce Posted October 5, 2018 Share Posted October 5, 2018 I apologize in advance if this should be obvious... Regarding destroying / removing cameras that I don't need anymore, I came across these two descriptions in the documentation that sound a bit contradicting to me: Camera.destroy(): Quote destroy() Destroys this Camera instance. You rarely need to call this directly. Called by the Camera Manager. If you wish to destroy a Camera please use CameraManager.remove as cameras are stored in a pool, ready for recycling later, and calling this directly will prevent that. CameraManager.remove(camera): Quote remove(camera) Removes the given Camera, or an array of Cameras, from this Camera Manager. If found in the Camera Manager it will be immediately removed from the local cameras array. If also currently the 'main' camera, 'main' will be reset to be camera 0. The removed Camera is not destroyed. If you also wish to destroy the Camera, you should call Camera.destroy on it, so that it clears all references to the Camera Manager. So for destroy() it says that I should use CameraManager.remove(). However for remove() it says that I need to call Camera.destroy() to clear all references. @rich What's the "clean" way to do it? Call remove() first and then destroy() after? Or just one of the two? Link to comment Share on other sites More sharing options...
rich Posted October 5, 2018 Share Posted October 5, 2018 Remove it and then destroy it. The destroy docs are out-dated. In 3.15 remove calls destroy automatically. blackhawx and jamespierce 1 1 Link to comment Share on other sites More sharing options...
jamespierce Posted October 5, 2018 Author Share Posted October 5, 2018 Just now, rich said: Remove it and then destroy it. The destroy docs are out-dated. In 3.15 remove calls destroy automatically. Okay thanks! Link to comment Share on other sites More sharing options...
Recommended Posts