I've created a laser gun similar to the quake railguns that appears as one solid line along with a varying amount of particles and stuff to make each players shot look unique. I got the beam to appear properly (no gaps where players are, stuff like that) but can't decide on the best way to do the hit detection. What I'm doing now is...
local pawn Q;
foreach TraceActors(class'Pawn', Q, HitLoc, HitNorm, EndLoc, (Location - (122 * vector(rotation))), vect(8,8,8))
{
log("laser has hit: " $ Q);
}
The problem is that returns EVERYTHING, not just pawns like it's supposed to(?). It works but I'm worried that it would be slow like that because I call the function which does damage every tick until the beam fades out. I can't really think of any other simple ways of doing it though. Anyone have any suggestions?
While we're on the subject anyone have any suggestions for ways to make the beam look cool? You can pick from 7 different colors and can change the color of the beam and particles that spawn. You can select how often along the beam the particles spawn, how big they are, how fast they move, and how much they "jitter" when they move. It looks really neat but more is always better as long as it doesn't take too many cpu cycles or cause fps drops.
local pawn Q;
foreach TraceActors(class'Pawn', Q, HitLoc, HitNorm, EndLoc, (Location - (122 * vector(rotation))), vect(8,8,8))
{
log("laser has hit: " $ Q);
}
The problem is that returns EVERYTHING, not just pawns like it's supposed to(?). It works but I'm worried that it would be slow like that because I call the function which does damage every tick until the beam fades out. I can't really think of any other simple ways of doing it though. Anyone have any suggestions?
While we're on the subject anyone have any suggestions for ways to make the beam look cool? You can pick from 7 different colors and can change the color of the beam and particles that spawn. You can select how often along the beam the particles spawn, how big they are, how fast they move, and how much they "jitter" when they move. It looks really neat but more is always better as long as it doesn't take too many cpu cycles or cause fps drops.