Climbing
by Shane Culliton · in Artist Corner · 06/30/2004 (8:07 am) · 4 replies
I would like my charactor (a monkey) to be able to climb drain pipes, ladders, etc...
Using trigers I am able to change the charactor from a walk sequence to a climb sequence.
However i am unable to get the charactor to move upwards off the ground:
below is an example of the code i am using:
Any help would be great!
Thanks.
Using trigers I am able to change the charactor from a walk sequence to a climb sequence.
However i am unable to get the charactor to move upwards off the ground:
below is an example of the code i am using:
datablock TriggerData( ClimbDrain1 )
{
tickPeriodMS = 100;
};
function ClimbDrain1::onEnterTrigger( %this, %trigger, %obj )
{
echo( "The player has just entered a climbable area!!!");
// need to modify physics data to counter gravity...
// if(inputKey = w ) move-up
// if(inputKey = z ) move-down
// HOW ????
Parent::onEnterTrigger( %this, %trigger, %obj );
}
function ClimbDrain1::onLeaveTrigger( %this, %trigger, %obj )
{
echo( "The player has just left a climbable area!!!");
Parent::onLeaveTrigger( %this, %trigger, %obj );
}
function ClimbDrain1::onTickTrigger( %this, %trigger )
{
echo( "The player is still in a climbable area!!!");
if (player.moving)
{
%player.playThread(0,"climb");
alxPlay(AudioProfilePlayerClimb, x,y,z);
}
Parent::onTickTrigger( %this, %trigger );
}Any help would be great!
Thanks.
About the author
#2
07/01/2004 (12:43 am)
Impulse? What's that!
#3
Often used with explosion or radius type damage. Allows you to apply and impuse (you could think "push") and object or player.
An example of use from radiusDamage.cs file
My guess for climibing is that you would have schedule multple impulses to constantly push the player up and keep him from falling back down.
07/01/2004 (5:10 am)
ApplyImpulseOften used with explosion or radius type damage. Allows you to apply and impuse (you could think "push") and object or player.
An example of use from radiusDamage.cs file
// Apply the impulse
if (%impulse) {
%impulseVec = VectorSub(%targetObject.getWorldBoxCenter(), %position);
%impulseVec = VectorNormalize(%impulseVec);
%impulseVec = VectorScale(%impulseVec, %impulse * %distScale);
%targetObject.applyImpulse(%position, %impulseVec);
}My guess for climibing is that you would have schedule multple impulses to constantly push the player up and keep him from falling back down.
Torque Owner Westy