Enabling and disabling air control
Air control is a fictitious force used by a number of games that allows a player to control their trajectory while falling or jumping in the air. Instead of just falling or jumping and hoping for the best, this allows the player to change course as necessary and trades realism for playability. We can find this type of control in first-person shooters, platformers, and adventure games. In this recipe we will learn how to enable or disable air control for a player, as well as limit its effect while in use.
How to do it...
We are about to modify a
PlayerData Datablock
instance to enable complete air control as follows:
Open your player's
Datablock
in a text editor, such as Torsion. The Torque 3D templates have theDefaultPlayerData Datablock
instance inart/datablocks/player.cs
.Find the section of the
Datablock
instance that contains theairControl
property and make the following change:jumpForce = "747"; jumpEnergyDrain = 0; minJumpEnergy = 0; jumpDelay...