So essentially what I’m trying to do is have several different display modes - a sort of Top-Down mode centered on a specific model, a Chase-Camera mode with the camera following behind the model, and a First-Person mode which is fairly similar to the Chase-Cam but you wouldn’t see the original model. All of these modes could be switched to at the push of an on-screen button.
The problem I’m running into is that I’d like to have different cameras for each view (to make the logic cleaner), but every time I’ve tried something to add/replace/change the camera it’s given me problems.
I’ve looked at all the documentation and several of them refer to things that don’t seem to apply (like the ViewPort tutorial) or sometimes show things that don’t work any more. Does anyone have an idea how I could use and replace different cameras? Right now I’m basically just using different nodes with all of the spatials for each mode defined seperately (so a 2D node, a Chase node, etc…), is that just how I need to do it?
Essentially I’d like to be able to do something like:
//Currently running on cam1, which is a top-down camera
… Stuff;
//Switch to cam2, which is the first-person mode
… Stuff;
//Switch back to cam1 and continue with that for a while
Each camera view would be a ViewPort… so I’m not sure I understand why exactly the ViewPort tutorial wasn’t relevant.
Also or otherwise, it helps to be more specific than “it’s given me problems”.
Or wait… do you only have one camera active at a time? If so, don’t switch the cameras just change the properties of the existing camera. Your life will be 100x easier.
Ah, sorry about that - had been banging my head into a wall with it and was getting frustrated.
I tried using multiple ViewPorts but things didn’t appear to display properly - I was using the simple X,Y,Z arrows mentioned in another tutorial and they were appearing distorted (the lines were bent) even though I set the height and width of the camera to match the window and the viewport to match the edges of the window. There was also a black, roughly-spherical shape in the center of the arrows.
At the moment I only have 1 camera active - I wasn’t sure how to disable the default camera and enable additional cameras. Since using multiple nodes has so-far worked, I think I can make do with using the single camera. I was just hoping that I could have multiple cameras so that I could seperate out the code to keep each piece distinct.
Thanks for the reply by the way! Wasn’t sure anyone would be able to help me.
If you want multiple cameras on screen at once then ViewPorts is definitely the way to go. Perhaps if you put together a test case that illustrates the problem you had with that then others will be able to help better.