function PuckArmor::onCollision(%this,%obj,%col,%thing,%other)
{
%fvec = vectorNormalize(%obj.getFowardVector());
%normal = vectorNormalize(%thing);
%vec1 = vectorMultiply(%fvec,%normal);
%vec2 = vectorMultiply(%normal,%vec1);
%vel = vectorAdd(vectorDist(%normal,%fvec),%vec2);
%obj.setVelocity(%vel);
if( %col.getClassName() $= "fxDTSBrickData" )
{
echo("onballhit");
%col.onBallHit( %obj.sourceObject, %obj );
}
//echo("PUCK COLLUSIONE!!!1!");
if(%col.getClassName() $= "Player")
%image = %col.getMountedImage(0);
//Echo(%image);
if(isObject(%image) && %image.HockeyStick )
{
echo("reg");
%col.unmountimage( 0 );
//echo("HOCKY STIK W PUCK");
%col.mountImage(HockeyStickWPuckImage, 0);
//echo("has puck");
%col.hasPuck = 1;
%col.hasSportBall = 1;
%obj.delete();
//echo("parent dat sheet");
return;
}
else if(isObject(%image) && %image.GoalieStick )
{
echo("goalie");
%col.unmountimage( 0 );
//echo("HOCKY STIK W PUCK");
%col.mountImage(GoalieStickWPuckImage, 0);
//echo("has puck");
%col.hasPuck = 1;
%col.hasSportBall = 1;
%obj.delete();
return;
}
parent::onCollision(%this,%obj,%col,%thing,%other);
}
whats wrong with this and why does it always say %obj is a brick