Changing the camera's view and control mode
Torque 3D offers a number of different camera modes that affect what the camera sees and how the user interacts with it. In this recipe, we will modify the standard camera's behavior and go through the available modes.
Getting ready
We will be making TorqueScript changes in a project based on the Torque 3D Full
template, and try them out using the Empty Terrain
level. If you haven't already, use the Torque Project Manager (Project Manager.exe
) to create a new project from the Full
template. It will be found under the My Projects
directory. Then start up your favorite script editor, such as Torsion, and let's get going!
How to do it...
In the following steps we will modify the third-person camera's behavior to allow only for rotation:
Open
scripts/server/gameCore.cs
in a text editor, such as Torsion.Add the following lines to
GameCore::onClientEnterGame()
:function GameCore::onClientEnterGame(%game, %client) { ... // Find a spawn point for the camera...