Reader small image

You're reading from  Torque 3D Game Development Cookbook

Product typeBook
Published inJan 2013
Reading LevelIntermediate
PublisherPackt
ISBN-139781849693547
Edition1st Edition
Languages
Right arrow
Author (1)
DAVID WYAND
DAVID WYAND
author image
DAVID WYAND

David Wyand has been using GarageGames' Torque Game Engine for the past 10 years. Among his other interestes are 3D graphics applications, computer networking and Artificial Intelligence for computer games.
Read more about DAVID WYAND

Right arrow

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:

  1. Open your player's Datablock in a text editor, such as Torsion. The Torque 3D templates have the DefaultPlayerData Datablock instance in art/datablocks/player.cs.

  2. Find the section of the Datablock instance that contains the airControl property and make the following change:

       jumpForce = "747";
       jumpEnergyDrain = 0;
       minJumpEnergy = 0;
       jumpDelay...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Torque 3D Game Development Cookbook
Published in: Jan 2013Publisher: PacktISBN-13: 9781849693547

Author (1)

author image
DAVID WYAND

David Wyand has been using GarageGames' Torque Game Engine for the past 10 years. Among his other interestes are 3D graphics applications, computer networking and Artificial Intelligence for computer games.
Read more about DAVID WYAND