Triggers
by Jason Wilson · in Torque Game Engine · 02/05/2007 (8:23 pm) · 1 replies
This might be a bit of a basic question, but I can't seem to get it working. When creating a trigger, how can we enumerate all objects which are contained in it? Here's what I'm playing around with so far:
function BattleArea::onTickTrigger( %this, %trigger )
{
%numObjects = %trigger.getNumObjects();
echo("Number of objects found: " + %numObjects );
Parent::onTickTrigger( %this, %trigger );
}
Now, to test this, I put 2 static objects within the trigger bounds, yet the above does not execute until I (well, my player) enters the trigger's space. And even then, the above only reports "1" object found (my player). It seems to ignore the existence of my other shapes completely. What could I be doing wrong?
Thanks,
Jason
function BattleArea::onTickTrigger( %this, %trigger )
{
%numObjects = %trigger.getNumObjects();
echo("Number of objects found: " + %numObjects );
Parent::onTickTrigger( %this, %trigger );
}
Now, to test this, I put 2 static objects within the trigger bounds, yet the above does not execute until I (well, my player) enters the trigger's space. And even then, the above only reports "1" object found (my player). It seems to ignore the existence of my other shapes completely. What could I be doing wrong?
Thanks,
Jason
Zod