So whenever I throw this knife sometimes it sticks to an object at a certain angle. At this point you hear loud repeated sword hit audio files and anyone who touches the weapon on the ground gets damaged by it.
How can I fix this?
I want the projectile to stick to objects but I don't want this weird glitch to occur. //Thrown projectile
datablock ProjectileData(BlackKnifeThrowProjectile)
{
projectileShapeName = "./BlackKnifeProjectile.dts";
directDamage = 100;
directDamageType = $DamageType::BlackKnife;
radiusDamageType = $DamageType::BlackKnife;
particleEmitter = spearTrailEmitter;
stickExplosion = BlackKnifeExplosion;
bloodExplosion = BlackKnifeExplosion;
explosion = arrowExplosion;
explodeOnPlayerImpact = true;
explodeOnDeath = true;
armingDelay = 30000;
lifetime = 30000;
fadeDelay = 30000;
isBallistic = true;
bounceAngle = 170; //stick almost all the time
minStickVelocity = 10;
bounceElasticity = 0;
bounceFriction = 0;
gravityMod = 0.25;
doColorShift = true;
colorShiftColor = "0.471 0.471 0.471 1.000";
hasLight = false;
lightRadius = 3.0;
lightColor = "0 0 0.5";
muzzleVelocity = 65;
velInheritFactor = 1;
lightColor = "0 0 0.5";
uiName = "Black Knife Throw";
};
// Initial start up state
stateName[0] = "Activate";
stateTimeoutValue[0] = 0.5;
stateTransitionOnTimeout[0] = "Ready";
stateSound[0] = swordDrawSound;
stateName[1] = "Ready";
stateTransitionOnTriggerDown[1] = "PreFire";
stateAllowImageChange[1] = true;
stateName[2] = "PreFire";
stateScript[2] = "onPreFire";
stateAllowImageChange[2] = false;
stateTimeoutValue[2] = 0.1;
stateTransitionOnTimeout[2] = "Fire";
stateName[3] = "Fire";
stateTransitionOnTimeout[3] = "CheckFire";
stateTimeoutValue[3] = 0.2;
stateFire[3] = true;
stateAllowImageChange[3] = false;
stateSequence[3] = "Fire";
stateScript[3] = "onFire";
stateWaitForTimeout[3] = true;
stateSound[3] = BlackKnifeSwingSound;
stateName[4] = "CheckFire";
stateTransitionOnTriggerUp[4] = "StopFire";
stateTransitionOnTriggerDown[4] = "Fire";
stateName[5] = "StopFire";
stateTransitionOnTimeout[5] = "Ready";
stateTimeoutValue[5] = 0.2;
stateAllowImageChange[5] = false;
stateWaitForTimeout[5] = true;
stateSequence[5] = "StopFire";
stateScript[5] = "onStopFire";
};