Clicking on an object in the scene (client-side)
Clicking on an object within the 3D world with the mouse is a common action in many games. Torque 3D allows for the processing of this action to occur on either the client or server side, depending on what is appropriate. Handling this on the client side is useful when the act of clicking on an object doesn't need to be authorized by the server, or we don't need all of the server-side gameplay information on an object in order to work with it. In this recipe, we will look into clicking on an object from the client and processing it on the client side.
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
folder.
How to do it...
In the following steps we will add an object to the scene...