Page 1 of 1

Posted: Thu Jun 20, 2019 9:42 am
Trigger based Jump Pad (like Quake 3)
This Trigger will launch the AI or Player wherever the Trigger is "facing".
This assumes you are familiar with creating and using Triggers within Torque.

UPDATE: The force that the Jump Pad pushes the AI or Player can now be set as a Dynamic Value within the Trigger itself. This will allow you to have multiple Jump Pads with various amounts of force within your mission.

datablock TriggerData(JumpPadTrigger)
{
tickPeriodMS = 1000;
};

{
//set the force the Jump Pad pushes the player at as a Dynamic Value

//get the direction the trigger is "facing" (theta)
%aim = %trigger.getForwardVector();

//take the getForwardVector and add some force

%impulseVec = vectorAdd(%impulseVec, "0 0 0");

//apply this to any AI/Player that enters the trigger
%obj.applyImpulse("0 0 0", %impulseVec);

}

{
ECHO("WHEE!");
}

After creating your JumpPadTrigger within the editor create a Dynamic Field called JumpPadForceRef and set its value to the amount of force you want to push the AI or Player at.