Game Development Community

Help with TGB Triggers

by David Deschenes · in General Discussion · 03/02/2009 (8:47 pm) · 2 replies

Hey all,

Im new to TGB and im wondering how to use triggers so any help would be awesome.

#1
03/02/2009 (9:21 pm)
Add one in the level editor, name it, use its ::onEnter method in script. There should be pretty good docs on it if you click on help from the level editor.
#2
03/02/2009 (10:00 pm)
well this is my snippit:

function TriggerClass :: onLevelLoaded(%this)
{
$Trigger = %this;

}

function TriggerClass :: onEnter(%this, %object)
{
echo("trigger has been entered");
$Platform.updateTriggerEnter();
}

function TriggerClass :: onLeave(%this, %object)
{
echo("trigger has been exited");
$Platform.updateTriggerExit();
}


and even when my charactr enters the trigger, it doesnt display anything in the console. what am i doing wrong?