Game Development Reference
In-Depth Information
Creating a soldier
Now, we'll take a brief look at what functionalities the soldier script provides and how we'll
go about using them.
The Soldier.SoldierStates and Soldier.WeaponStates tables provide a list
of all the available animation states for both the soldier and the soldier's weapon animation
state machines.
The Soldier_AttachWeapon function will attach the soldier's weapon mesh to the
proper bone with the correct position and rotation offsets:
function Soldier_AttachWeapon(soldier, weapon)
Soldier_CalculateSlowSteering will return a steering vector tuned toward the
agents slowly moving throughout the environment. This will be the steering function we'll
use when the agent is crouching:
function Soldier_CalculateSlowSteering(agent,
deltaTimeInSeconds)
Soldier_CalculateSteering returns the original steering vector we calculated pre-
viously when our agent was running upright:
function Soldier_CalculateSteering(agent, deltaTimeInSeconds)
Soldier_CreateLightSoldier creates a soldier mesh attached to an agent with
black and white armor:
function Soldier_CreateLightSoldier(agent)
Soldier_CreateSoldier creates a soldier mesh attached to an agent with black and
red armor:
function Soldier_CreateSoldier(agent)
Soldier_CreateSoldierStateMachine creates and initializes an animation state
machine already configured with states and transition setups for an animated soldier mesh.
Additional crouch states and transitions are handled within this version of the state ma-
chine:
Search WWH ::




Custom Search