Hello, I'm trying to get the position of a bullet impact without success. My problem is that I don't know how to do a TraceLine from the player position to the aim direction.
HitResult hr = World.TraceLine(chr.Position, chr.GetOffsetPositionFront(100f), TraceFlags.IntersectEverything, chr);
if(hr.Hit)
{
Vector3 pos = hr.HitPosition;
World.SpawnExplosion(pos, 0, 3f, true, false, 0.5f);
}
This piece of code just traces a straight line in relation to the current player position, not what I actually want.
I have tried to create a Camera setting it to the same position and direction of the player and then use this example from documentation but again without success.
The thing is that I have no idea how to make this work. I think about all the possible math with angles and vectors and I'm not a math guy.
Thanks!