Author Topic: Trigger help[Solved]  (Read 1402 times)

wizardry math.
Lol.
Thanks for the help, I was more referring to what value would I change.

How would I get the trigger to take the full shape of the brick?
Code: [Select]
function fxDtsBrick::createTrigger(%this,%data,%polyhedron)
{
//credits to Space Guy for showing how to create triggers
if(!isObject(%data))
{
Slayer_Support::Error("fxDtsBrick::createTrigger","Trigger datablock not found.");
return 0;
}

if(%polyhedron $= "")
%polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1";

if(isObject(%this.trigger))
%this.trigger.delete();

%t = new Trigger()
{
datablock = %data;
polyhedron = %polyhedron;
};
missionCleanup.add(%t);

%boxMax = getWords(%this.getWorldBox(), 3, 5);
%boxMin = getWords(%this.getWorldBox(), 0, 2);
%boxDiff = vectorSub(%boxMax,%boxMin);
%boxDiff = vectorAdd(%boxDiff,"0 0 0.2");
%t.setScale(%boxDiff);
%posA = %this.getWorldBoxCenter();
%posB = %t.getWorldBoxCenter();
%posDiff = vectorSub(%posA, %posB);
%posDiff = vectorAdd(%posDiff, "0 0 0.1");
%t.setTransform(%posDiff);

%this.trigger = %t;
%t.brick = %this;

return %t;
}

I ran into an issue again.

What do the arguments your using for Triggname::OnEnterTrigger stand for?

Is there a way to pass the bricks ID on to the onEnterTrigger?

I ran into an issue again.

What do the arguments your using for Triggname::OnEnterTrigger stand for?

Is there a way to pass the bricks ID on to the onEnterTrigger?
%this is the trigger's datablock, %trigger is the trigger, and %obj is the object that entered the trigger.

To get the trigger's brick do %brick = %trigger.brick;