2D Toolkit Forum
2D Toolkit => Support => Topic started by: JakeTBear on February 05, 2014, 10:56:21 pm
-
Hello,
Just like the title says, what would be the best way to create a camera at run time, what I am trying to do is to avoid using the editor for setup and instead having a prefab that does all the setups for me through script.
I would also need to create a second camera for UI, how would I set this up in code?
Thanks!
-
You can simply create it as you would any other component in Unity. A lot of the interface functions aren't fully exposed as its meant to be tweaked using the UI, and as a result it will probably be a bit more complicated to set it up than it would otherwise, but its definitely doable.
tk2dCameraEditor.DoCreateCameraObject is what runs when you create a camera in the UI. Thats probably a good starting point.
-
perfect! thanks!