Hi, I have a need to make a beam that consists of a particle and for this I have 2 points: the starting position and the ending one. Particle is an emitter that leaves a trail behind. Simply put, I want to make a ray from a trail of particle from point A to point B.
How can I operate with a particle so that a ray is formed from the starting point and the ending point?
PHP Code:
stock void SpawnParcticle(const char[] effect, const char[] targetname, const float pos[3], const float endpos[3])
{
int particle = CreateEntityByName("info_particle_system");
DispatchKeyValue(particle , "start_active", "0");
DispatchKeyValue(particle, "effect_name", effect);
DispatchKeyValue(particle, "targetname", targetname);
DispatchSpawn(particle);
//TeleportEntity(particle, pos, NULL_VECTOR,NULL_VECTOR);
TeleportEntity(particle, endpos, NULL_VECTOR,NULL_VECTOR);
ActivateEntity(particle);
AcceptEntityInput(particle, "Start");
char szBuffer[128];
FormatEx(szBuffer, sizeof(szBuffer), "OnUser1 !self:kill::%0.2f:-1", g_fLife);
SetVariantString(szBuffer);
AcceptEntityInput(particle, "AddOutput");
AcceptEntityInput(particle, "FireUser1");
}
This function so far just creates a particle at the endpoint and simply deletes it after a while