Jump to content

Camera: Contradiction in Doc for remove() and destroy()?


Recommended Posts

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:




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.




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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...