Author Topic: Making a projectile stick to people  (Read 3813 times)

Well, you'd want to use the same particle emitter for the 'stuck' grenade as you have for the projectile.

Done, added it under the projectile

Code: [Select]
datablock ParticleData(hplasmagrenadeStuckParticle)
{
dragCoefficient = 5.0;
windCoefficient = 0.0;
gravityCoefficient = -0.6;
inheritedVelFactor = 0.0;
constantAcceleration = 0.0;
lifetimeMS = 400;
lifetimeVarianceMS = 0;
spinSpeed = 10.0;
spinRandomMin = -50.0;
spinRandomMax = 50.0;
useInvAlpha = false;
animateTexture = false;
//framesPerSec = 1;

textureName = "base/data/particles/cloud";
//animTexName = " ";

// Interpolation variables
colors[0] = "0 1 1 0.5";
colors[1] = "1 1 1 0.2";
colors[2] = "0 1 1 0.5";
sizes[0] = 0.65;
sizes[1] = 0.55;
sizes[2] = 0.65;
times[0] = 0.0;
times[1] = 0.1;
times[2] = 1.0;
};

datablock ParticleEmitterData(hplasmagrenadeStuckEmitter)
{
   ejectionPeriodMS = 3.5;
   periodVarianceMS = 0;

   ejectionVelocity = 0.5; //0.25;
   velocityVariance = 0; //0.10;

   ejectionOffset = 0.2;

   thetaMin         = 0.0;
   thetaMax         = 90.0; 

   particles = hplasmagrenadeStuckParticle;
};

No no no.  You don't need separate datablocks.  Just reference the ones you've already made.

Hmm, i ain't quite sure how to do that...

Well referencing your old datablocks would mean that once you mount a static shape of your grenade .dts, you also add the same particle emitter of the thrown grenade to the mounted grenade.

A code should help me... I should get an idea of what to do with it