Guy’s don’t laugh when I ask this 
I will list what I am trying to accomplish below:
I am using a basic FPS camera with the joystick controllers for the iPhone:
- I want when I fire a projectile (Sphere) the following occurs:
(a) switch from the FPS camera to camera two
(b) after the projectile collides with another RB it switches back to the FPS camera.
This might not be the best way of doing it. I cannot think of a better way. The other option: is Only follow projectile when a certain key is pressed…
Can anyone help me in the right direction. Thank you
Hey there – no laughing
– everyone here had to learn just like everyone else.
It sounds like you are on the right track with multiple cameras, but a few things to consider. Toggling the active camera(s) is easy enough to do with scripting, but while camera 2 is busy following your projectile, your character and camera 1 are still “live” and likely milling around and potentially running into enemies etc while the engine is displaying the projectile flying towards a target.
If you don’t need to fullscreen the projectile, keep in mind that you can have as many cameras rendering as you like at any given time. For “projectile-cams” like this, you could do a mini-window of sorts by using the Normalized Viewport approach. That way you have full control over your character and display same and at the same time you get the scaled down viewport rendering the projectile.
Does that get you closer, or are you really looking for rendering the projectile’s flight fullscreen and then back to your main character?
@BoredKoi - thanks for the tip:
My fear is that on the iPhone screen it would be so tiny that it would not be of much help. To your point, when the camera is following the projectile my players is left behind.
Maybe this will help more.
You never see the player, because really it’s a ball that when you fire I want the camera to attach itself to that way you can use the accelorometer (sp) to control where it goes with a little tilt action. I do want it to break out of following the project as soon as it collides with another object.
Ah gotchya – yeah, a mini map on iPhone is truly mini (lolz) and squinting iPhone gamers are no good. Now that I understand you scenario a bit better, I’d just use one camera with something along the lines of the SmoothFollow scripts and just change the .target via script to the ball whilst its in the air, and then back to the cannon or what not when it’s finished. You can also use coroutines to add a little time-padding in there so the camera doesn’t feel jerky, if that makes sense. (i.e., after impact maybe rotate it around the affected target for a second, show off some particles, and then back to your character / gun or whatever).
Excellent idea mate! Thank you