Hello,
I want the smoke to come out in the direction of the player,i.e,
it should look like as if the player is spraying.

This is the code i am using and the player is PlBiped(A6 template).

BMAP px_tga = "smog_02.tga";
function fade_p()
{
my.alpha -= 10 * time_step;
if (my.alpha < 0) {my.lifespan = 0;}
}


function effect_x()
{
my.alpha = 30 + random(65);
my.flare = on;
my.bmap = px_tga;
my.size = 12;
my.bright = on;
my.move = on;
my.function = fade_p;
}

function create_px()
{
var temp_pos;
var temp_var;
while (1)
{
temp_pos.x += 20 * cos(plBiped01_entity.x); // 20 = particle radius
temp_pos.y += 20 * sin(plBiped01_entity.x); // use the same value here
effect(effect_x, 1, temp_pos.x, nullvector);
wait (1);
}
}
on_m = create_px;

Last edited by prog; 04/01/08 06:39.