Clicking on an object in the scene (server-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 action on the server is useful when the act of clicking needs to be authorized by the server (such as making sure an object is in the player's line of sight and they are not cheating), or we need to make use of the 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 server 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
directory. Then start...