Thank you for the tips Superku.

Do you know if its possible to use vec_for_vertex on a ent_createlayer entity?

I've been trying for many hours to figure it out.

Basically the first person weapon is created at the start of the game using ent_createlayer.

When the gun is firing the intention is to create a muzzle flash at the vertex # of the tip of the gun. For some reason it is not appearing when the gun fires (bullets are surely coming out though).

The code in the gun firing function:

VECTOR mgun_tip;

vec_for_vertex(mgun_tip, plyr_machinegun, 32);

ent_create (mgun_flash_mdl, mgun_tip, muzzle_flash);

function muzzle_flash()
{
set (my, PASSABLE);
set (my, TRANSLUCENT);
my.ambient = 100;
my.roll = random(360);
my.scale_x = 5.4;
my.scale_y = my.scale_x;
wait (-0.25);
ent_remove (my);
}


June
smooth-3d.com