I want the player getting hit to be pushed back. It doesn't work, and I don't know why.
$pushBack::Amount = 15;
package stunstick
{
function stunstickProjectile::OnCollision(%this, %obj, %col, %fade, %pos, %normal)
{
if(%col.getClassName() $= "Player" || %col.getClassName() $= "AIPlayer")
{
%col.setWhiteOut(1);
%col.setVelocity(vectorAdd(%col.getVelocity(),vectorScale(%this.getEyeVector(),$pushBack::Amount)));
}
parent::Oncollision(%this, %obj, %col, %fade, %pos, %normal);
}
};
ActivatePackage(stunstick);