in an attempt to learn UE4 blueprints, I’ve made myself a challenge to fully recreate all functionality of Wolfenstein 3D game. Right now, I am creating a logic for shooting and hitting enemies. I am using a LineTrace to detect the hit, as shown on this screenshot:
At the moment, I can hit the enemies even through doors and walls, since the line just goes and ignores anything until it hits the object of the right class in the array. So first thing that came to my mind is first do LineTrace for obstacle, and if the hit is true, do nothing, if the hit is false, do trace for enemy pawn. I was just wondering if doing two line traces isn’t too expensive, and if there is possibly any way to perform check for obstacle with just a single line trace.