Using second camera
by CodingChris · in Torque Game Engine · 12/20/2007 (3:31 pm) · 2 replies
Hi,
sorry for the silly question, but how to use a second camera?
What I want to do:
I've got the default camera moving with the player.
During a special event I want another camera just to show a static view.
I can simply create the second camera in the mission editor, but how do I use this camera?
sorry for the silly question, but how to use a second camera?
What I want to do:
I've got the default camera moving with the player.
During a special event I want another camera just to show a static view.
I can simply create the second camera in the mission editor, but how do I use this camera?
About the author
Torque Owner Michael Bacon
Default Studio Name
Here is an example that you could use in the console, this assumes your camera is named 'camera1'.
I use an ever slightly more complex method that will work over a real network connection.
// This must be accessible to the client scripts function setCam(%camera) { commandToServer('setCamera', %camera); } // This must be placed in the server scripts function serverCmdSetCamera(%client, %camera) { %client.setCameraObject(%camera); }These methods are only needed if you want the client to be able to trigger the camera change (excellent for debugging purposes). If you are triggering the camera change from a trigger callback your should just set the new camera object on the client directly cutting out the server command call.
Be careful as changing viewpoints may cause strange things to happen if your not prepared for them . Ask questions when needed.