Game Development Community

Sticking with explosion impact.

by Lord Tony · in Torque Game Engine · 11/05/2010 (9:12 am) · 1 replies

I am playing a torque game called Blockland I am having a little trouble with the object I am trying to make. I am making a spear it is suppose to stick to objects and explode on impact. What keeps happening is the spear sticks to objects but then explodes a few seconds after. Also with a little edit to 'lifetime' then the spear will explode on impact but not stick. How can I get the spear to stick to objects for a few seconds and explode on impact?

//projectile
AddDamageType("SpearDirect", '<bitmap:add-ons/Weapon_Spear/CI_spear> %1', '%2 <bitmap:add-ons/Weapon_Spear/CI_spear> %1',1,1);

datablock ProjectileData(spearProjectile)
{
projectileShapeName = "./spearProjectile.dts";

directDamage = 50;
directDamageType = $DamageType::SpearDirect;

radiusDamage = 0;
damageRadius = 0;
directDamageType = $DamageType::SpearDirect;
explosion = spearExplosion;
particleEmitter = spearTrailEmitter;
explodeOnPlayerImpact = true;
explodeOnDeath = true;

armingDelay = 4000;
lifetime = 4000;
fadeDelay = 4000;

isBallistic = true;
bounceAngle = 170; //stick almost all the time
minStickVelocity = 10;
gravityMod = 0.25;

hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";

muzzleVelocity = 65;
velInheritFactor = 1;

uiName = "Spear";
};

#1
05/07/2011 (12:34 pm)
I believe it's the

armingDelay = 4000;

that is causing it to not explode on contact. Set that to 0 and it should explode on contact.