Switching cameras dynamically

hi everyone,
im stuck with the above :D,i cant figure out how to make a second camera active after pressing a button sensor…oka heres my scenario, i already set up a .py script to move the camera around on a mouse movement,but this way i can only see my character from behind, so what i want is to activate a second camera after pressing an specific button then i can rotate the sec cam to look around the character,sort of a like camera actuator,is that possible to set up in logic bricks? and after releasing the button use a controller NAND to switch back to the main one…
if its not asking too much i was also wondering how to set up a mouse cursor so i can see it while the moving the mouse around ,just like an aim and to only move the camera when i press right button and move the mouse lol oka this is too much for a single thread but thats just to expose some ideas as well…i kindof have a couple ideas in mind but any input here is greatly apreciated!
Thanks in advance,
ShortK

I’m kinda confused as to what you mean, but have you checked this out yet? It’s basically a tutorial on switchin’ cameras…

If you’re changing the camera the mouselook uses, it may depend on the script you’re using, but if all else fails, you could combine the above tutorial with a second camera setup to use its own mouselook…

As far as changing what moves the mouselook, it might also depend on the script, but shouldn’t be to hard --another mouse sensor and half-a-line of code…

The Scene actuator has a Set Camera. You can also change the camera with Python:


# 2.5 code
import bge

scene = bge.logic.getCurrentScene()

scene.active_camera = scene.objects['orbit_cam']

# 2.49 code
scene = GameLogic.getCurrentScene()

scene.active_camera = scene.objects['OBorbit_cam']

Wow nice guys thanks a lot for all the support here and yeah the text defenetly looks odd and a bit confusing but thats due to my state of mind lately but anyways i hope now i can now apply the methods mentioned above!
again thank you so much guys that made my day :smiley: later ill be posting another glitch im facing which is related to bones action,i cant set it up to move only when i collides with the floor(ofc Floor propertie is already created as i needed it fr the servo control stuff ^^)
Kind regards,
ShortK

Thanks guys it worked like a charm :wink: i really appreciate it ,i was trying to use the camera actuator instead of the scene act _ thats why…i completely forgot that the scene actuator had the camera switch option hehe
unfortunatly the final effect wasnt like i expect so my guess is ,i might have to rellaborate how the cameras will interact wit each other then if i have any glitch ima post it here again so maybe u guys can get me some extra help :smiley: