I have my projectile working as described in this tutorial (https://www.youtube.com/watch?v=FwVYXlsTPD4 roughly 7 mins in is the blueprint, my code is written in c++ based on this), but ran into a issue with my game being in third person only. When my player is too close to a wall (or low cover) on his right hand side, the line trace from the camera to the center of the crosshair hits somewhat behind my player or off to his side and the projectile shoots backwards or to the side depending on the location of the hit. Since it has a “hit” it still uses this direction and thus shoots in an unwanted location, sometimes even hitting himself.
Is there a way to know that the hit location is behind the gun/player and not the actual intended location? I was thinking of using vector math but I am not too strong in that subject and it has been a while since I’ve used it. Can’t figure this one out. Someone have any suggestions on how to know if the line trace hit was behind the player?