a problem with Triggers
by Ezio_online · in Torque Game Builder · 11/19/2009 (11:19 am) · 5 replies
excuse me ,my english isn't very good , because i'am not american or british.
i want to shake camera when the object enter the Trigger . for this , i create a trigger with name of "a" and an object . then create a behavior and write this code into behavior:
function xbehavior::onEnter(a,%this)
{
t2dSceneWindow.startCameraShake(12,4);
}
and i set this Behavior for the Object . but it doesn't work . what is problem ?
i want to shake camera when the object enter the Trigger . for this , i create a trigger with name of "a" and an object . then create a behavior and write this code into behavior:
function xbehavior::onEnter(a,%this)
{
t2dSceneWindow.startCameraShake(12,4);
}
and i set this Behavior for the Object . but it doesn't work . what is problem ?
#2
name : a
class : xbehavior
superclass :(blank)
this is complete code of behavior :
if (!isObject(TTTBehavior))
{
%template = new BehaviorTemplate(TTTBehavior);
%template.friendlyName = "TTTBehavior";
%template.behaviorType = "Trigger";
%template.description = "TTTBehavior";
}
function TTTBehavior::onEnter(a,%this)
{
t2dSceneWindow.startCameraShake(10, 3);
}
IS THERE PROBLEM ?
11/19/2009 (1:31 pm)
is your mean , i must set the scripting tab of Trigger this form ?name : a
class : xbehavior
superclass :(blank)
this is complete code of behavior :
if (!isObject(TTTBehavior))
{
%template = new BehaviorTemplate(TTTBehavior);
%template.friendlyName = "TTTBehavior";
%template.behaviorType = "Trigger";
%template.description = "TTTBehavior";
}
function TTTBehavior::onEnter(a,%this)
{
t2dSceneWindow.startCameraShake(10, 3);
}
IS THERE PROBLEM ?
#3
11/19/2009 (3:15 pm)
help me , please !!! i need this for my game .
#4
Also, check out the Behavior Playground example. It's probably already got something you need.
11/19/2009 (4:17 pm)
Have you tried the various tutorials, including the behavior tutorial? I only say this because there are fundamental errors in your code.Also, check out the Behavior Playground example. It's probably already got something you need.
#5
11/20/2009 (12:49 pm)
thank you very much !!
Torque Owner Pubily