Game Development Community

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

About the author

Recent Threads


#1
02/06/2007 (12:30 am)
I believe triggers will only handle player, vehicle and item data. Nothing else will trigger them. I am not positive itemData will either. So this is the reason.