Author Topic: Trigger isn't following the static shape?  (Read 1288 times)

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?
Code: [Select]
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));
}
« Last Edit: July 14, 2015, 09:02:00 PM by Kyuande »

do you know for sure the bottom bit of code is being run?
add some echos so you know exactly what is being run, and try changing it manually in the console and see if that works

Yeah, every time this function calls, it's the only function that seems to change the world box. Everything else works fine.

post the actual code you're using, with echos
and also post what it outputs when you call it
also echo before and after states to compare them to what you expect them to be

I'll post some code tomorrow.