Game Development Community

How do i determine who entered a trigger??

by Maximillian Brewer · in Torque Game Engine · 07/26/2009 (6:03 pm) · 2 replies

I have created my own little dialog system using a .gui, and to initiate the gui I have triggers that onEnter fires up the GUI.

This works fine and i like the result, except if an AI bot runs to attack me and runs through the trigger, the GUI is pushe onto the players screen, and that is not what I want :(

If anyone knows how to only push the GUI if the player enters the trigger that would be great :D

(I am using TGE 1.5.2)

#1
07/26/2009 (6:45 pm)
For diferentiating between a player and an AI, use getclassname()
%checkclass = %obj.getclassname();
   if(%checkclass $= "player")
	{

echo("PLAYER in trigger");
//now do something
	}
	else
	{
echo("NOT player in trigger");
//do not do something
	}
#2
07/26/2009 (6:47 pm)
thanks, will try this out :D