Author Topic: Low Friction Projectile  (Read 1799 times)

Code: [Select]
datablock ProjectileData(PuckProjectile)
{
sportBallImage = "PuckImage";
projectileShapeName = "./puck.dts";
explosion           = "";
bounceExplosion     = "";
particleEmitter     = ballTrailEmitter;
explodeOnDeath = true;

brickExplosionRadius = 0;
brickExplosionImpact = 0;             //destroy a brick if we hit it directly?
brickExplosionForce  = 0;            
brickExplosionMaxVolume = 0;          //max volume of bricks that we can destroy
brickExplosionMaxVolumeFloating = 0;  //max volume of bricks that we can destroy if they aren't connected to the ground (should always be >= brickExplosionMaxVolume)

sound = "";

muzzleVelocity      = 0;
    restVelocity        = 0;
velInheritFactor    = 1.0;

armingDelay         = 12000;
lifetime            = 60000;
fadeDelay           = 11500;
bounceElasticity    = 0.3;
bounceFriction      = 0;
isBallistic         = true;
gravityMod          = 1;

hasLight    = false;

uiName = "Hockey Puck";
};
How do I make this have less friction and slide across the ground?

and

whats wrong with this and why won't it work
Code: [Select]
function Armor::onCollision(%this, %obj, %col, %thing, %other)
{
if(isObject(%obj.client))
{
if(%col.getDatablock() == PlayerIceHockeyArmor.getID())
%col.setVelocity(vectorAdd(%col.getVelocity(),vectorScale(%player.getVelocity,$Push::Amount)));
}
parent::OnCollision(%this, %obj, %col, %thing, %other);
}
it's in a package btw

it spams the console with onCollision is an unknown command
« Last Edit: May 27, 2013, 05:54:51 PM by Aide33 »

it spams the console with onCollision is an unknown command

Because armor::onCollision isn't defined by default. It's just a callback that is only run if it is defined somewhere. You're using parent::onCollision even though the function did not exist at first.

try using bounceElasticity = 0.999;
from what i can tell, that and bounceFriction = 0; make it almost never stop moving.