Is the target supposed to be the thing hit by the bullet? If so, you can do this one of two ways:Gutawer wrote:What's the cleanest way to send out a hitscan from a position in 3d space? Spawning an actor to send out the hitscan seems to work nicely, but I can't figure out how to make it transfer the target to the actor that is "supposed" to have sent out the hitscan.
1. Use LineAttack in conjunction with passing an FTranslatedLineTarget struct.
Check to see if the struct's "linetarget" exists.
Code: Select all
// returned by AimLineAttack.
struct FTranslatedLineTarget
{
Actor linetarget;
double angleFromSource;
double attackAngleFromSource;
bool unlinked; // found by a trace that went through an unlinked portal.
native void TraceBleed(int damage, Actor missile);
}
2. Give the puff +HITTRACER, or HITMASTER flag, in addition to +PUFFGETOWNER. The puff will then set the entity hit as its own tracer/master, which the puff can then transfer that to the target pointer, which is the one who shot the bullet.
Method 1 would be best -- you can offset this hitscan along the Z axis as well.