I have "bullets" using c-trace instead of an actual flying model. However, since I am using a trace, how can I add an nice bullet trace effect, especially since the bullet (trace) will have an immediat impact. Maybe an after image or something like that?
is it passable to play sounds at specific vector or traceed positions?
Code:
ent_playsound(hit,impact,100);//play impact sound from actual impact location.
OR
ent_playsound(vectorposition,impact,100);//play bullet flyby sound from current vector position
If you want to play impact sound, simply create a dummy model at hit->x position (or target.x) and play ent_playsound at it (note that there should be a pointer to ENTITY, not vector as you've used in your example). After sound was played, remove that dummy model.
Example:
Code:
void impact(){
var snd_handle = ent_playsound(my, impact_wav, 500);
while(my){
if(!snd_playing(snd_handle)){ break; }
wait(1);
}
safe_remove(my);
}
// in bullet function
if(trace_hit){
ent_create(NULL, &hit->x, impact);
}