Locking and hiding the mouse while the right mouse button is down
Using the left mouse button to select and the right mouse button to activate camera rotation is a common control scheme found in many games that allow for free looking, such as role-playing games. In this recipe, we will modify the default FPS (First Person Shooter) camera control behavior of Torque 3D and allow holding down the right mouse button to control the rotation of the camera to freely look around.
Getting ready
We will be making TorqueScript changes in a project based on the Torque 3D Full
template, and will try them out using the Empty Terrain
level.
If you haven't already, use the Torque Toolbox Project Manager (Project Manager.exe
) to create a new project from the Full
template. This template can be found under the My Projects
folder. Next, start up your favorite script editor, such as Torsion, and let's get going!
How to do it...
In the following steps we will alter Torque 3D's default mouse behavior to freely...