Game Development Community

Camera Enter Triggers

by Shez · in Torque Game Engine · 10/10/2005 (10:20 pm) · 3 replies

Hi everybody...I really need help here. In my game im trying to add a trigger to a camera path. When the camera enters the trigger, it would spawn some enemies. But it seems that the camera doesnt call trigger or vise versa. Is it because the camera is not an object. Can i do this through script without touching any codes in the engine?... Thanks.



shez

#1
10/12/2005 (1:27 pm)
Without code changes... hard. You can use a schedule to have a function going ever few hundred milliseconds, do a radiusContainerSearch around the camera position to look for triggers, then check if the camera point is inside the trigger bounding box.

You could also have an invisible shape follow the camera by using a schedule.
#2
10/13/2005 (1:35 am)
So what you mean is to have a radius search for the camera to look for triggers..And then in the trigger add schedule for the spawn...rite....How do i actually implement radiusContainerSearch??...Im very new to torque...please do mind me.
#3
10/19/2005 (12:45 pm)
First of all: I think it's ok that TGE's philosophy doesn't support cameras triggering anything. So I wouldn't change the code there, as you suggested in another thread.

I think the most Torque-ish way to do this could be to create a DTS with just a root node and a camera node very close together. Then you create an AIplayer object that runs on the same path you want the camera to run.

So you are looking over the shoulder of the Aiplayer object that should be activating the trigger - I think.