I've wrote this code to fix the laser's trigger position and angle based on the laser. The laser is a static shape. Any ideas on why it isn't correctly following the static shape?
function fxDTSBrick::CheckLaser(%this)
{
if(!isObject(%laser = %this.laser))
return;
if(!isObject(%trigger = %laser.trigger))
return;
%boxMax = getWords(%laser.getWorldBox(), 3, 5);
%boxMin = getWords(%laser.getWorldBox(), 0, 2);
%boxDiff = vectorSub(%boxMax, %boxMin);
%trigger.setScale(%boxDiff);
%trigger.setTransform(%laser.getWorldBoxCenter() SPC getWords(%laser.getTransform(), 3, 6));
}